summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-02-22 23:13:40 +0100
committerGitHub <noreply@github.com>2020-02-22 23:13:40 +0100
commita7891b9d120e1cb49bcdcffc1107f692ed481d86 (patch)
tree79020d96a7335c403e4401cffddf76b13fef4fc7
parent5ee50db3f334ec9a84ff956dbf1d1be3ac963072 (diff)
parent17a81cffb21a3bebfe38cbc9150385439e4440de (diff)
downloadredot-engine-a7891b9d120e1cb49bcdcffc1107f692ed481d86.tar.gz
Merge pull request #36463 from akien-mga/scons-msvc-c++17-cxxflags
SCons: Ensure that MSVC gets /std:c++17 in CCFLAGS
-rw-r--r--SConstruct19
1 files changed, 10 insertions, 9 deletions
diff --git a/SConstruct b/SConstruct
index eb59db006d..0c0e7ed681 100644
--- a/SConstruct
+++ b/SConstruct
@@ -309,9 +309,19 @@ if selected_platform in platform_list:
env['LINKFLAGS'] = ''
env.Append(LINKFLAGS=str(LINKFLAGS).split())
+ # Platform specific flags
+ flag_list = platform_flags[selected_platform]
+ for f in flag_list:
+ if not (f[0] in ARGUMENTS): # allow command line to override platform flags
+ env[f[0]] = f[1]
+
+ # Must happen after the flags definition, so that they can be used by platform detect
+ detect.configure(env)
+
# Set our C and C++ standard requirements.
# C++17 is required as we need guaranteed copy elision as per GH-36436.
# Prepending to make it possible to override.
+ # This needs to come after `configure`, otherwise we don't have env.msvc.
if not env.msvc:
# Specifying GNU extensions support explicitly, which are supported by
# both GCC and Clang. Both currently default to gnu11 and gnu++14.
@@ -322,15 +332,6 @@ if selected_platform in platform_list:
# We apply it to CCFLAGS (both C and C++ code) in case it impacts C features.
env.Prepend(CCFLAGS=['/std:c++17', '/permissive-'])
- # Platform specific flags
- flag_list = platform_flags[selected_platform]
- for f in flag_list:
- if not (f[0] in ARGUMENTS): # allow command line to override platform flags
- env[f[0]] = f[1]
-
- # Must happen after the flags definition, so that they can be used by platform detect
- detect.configure(env)
-
# Configure compiler warnings
if env.msvc:
# Truncations, narrowing conversions, signed/unsigned comparisons...