|
@@ -803,7 +803,7 @@ elif env.msvc:
|
|
env.Append(CXXFLAGS=["/EHsc"])
|
|
env.Append(CXXFLAGS=["/EHsc"])
|
|
|
|
|
|
# Configure compiler warnings
|
|
# Configure compiler warnings
|
|
-if env.msvc: # MSVC
|
|
|
|
|
|
+if env.msvc and not methods.using_clang(env): # MSVC
|
|
if env["warnings"] == "no":
|
|
if env["warnings"] == "no":
|
|
env.Append(CCFLAGS=["/w"])
|
|
env.Append(CCFLAGS=["/w"])
|
|
else:
|
|
else:
|
|
@@ -853,8 +853,11 @@ else: # GCC, Clang
|
|
# for putting them in `Set` or `Map`. We don't mind about unreliable ordering.
|
|
# for putting them in `Set` or `Map`. We don't mind about unreliable ordering.
|
|
common_warnings += ["-Wno-ordered-compare-function-pointers"]
|
|
common_warnings += ["-Wno-ordered-compare-function-pointers"]
|
|
|
|
|
|
|
|
+ # clang-cl will interpret `-Wall` as `-Weverything`, workaround with compatibility cast
|
|
|
|
+ W_ALL = "-Wall" if not env.msvc else "-W3"
|
|
|
|
+
|
|
if env["warnings"] == "extra":
|
|
if env["warnings"] == "extra":
|
|
- env.Append(CCFLAGS=["-Wall", "-Wextra", "-Wwrite-strings", "-Wno-unused-parameter"] + common_warnings)
|
|
|
|
|
|
+ env.Append(CCFLAGS=[W_ALL, "-Wextra", "-Wwrite-strings", "-Wno-unused-parameter"] + common_warnings)
|
|
env.Append(CXXFLAGS=["-Wctor-dtor-privacy", "-Wnon-virtual-dtor"])
|
|
env.Append(CXXFLAGS=["-Wctor-dtor-privacy", "-Wnon-virtual-dtor"])
|
|
if methods.using_gcc(env):
|
|
if methods.using_gcc(env):
|
|
env.Append(
|
|
env.Append(
|
|
@@ -876,9 +879,9 @@ else: # GCC, Clang
|
|
elif methods.using_clang(env) or methods.using_emcc(env):
|
|
elif methods.using_clang(env) or methods.using_emcc(env):
|
|
env.Append(CCFLAGS=["-Wimplicit-fallthrough"])
|
|
env.Append(CCFLAGS=["-Wimplicit-fallthrough"])
|
|
elif env["warnings"] == "all":
|
|
elif env["warnings"] == "all":
|
|
- env.Append(CCFLAGS=["-Wall"] + common_warnings)
|
|
|
|
|
|
+ env.Append(CCFLAGS=[W_ALL] + common_warnings)
|
|
elif env["warnings"] == "moderate":
|
|
elif env["warnings"] == "moderate":
|
|
- env.Append(CCFLAGS=["-Wall", "-Wno-unused"] + common_warnings)
|
|
|
|
|
|
+ env.Append(CCFLAGS=[W_ALL, "-Wno-unused"] + common_warnings)
|
|
else: # 'no'
|
|
else: # 'no'
|
|
env.Append(CCFLAGS=["-w"])
|
|
env.Append(CCFLAGS=["-w"])
|
|
|
|
|
|
@@ -1032,7 +1035,9 @@ if env["vsproj"]:
|
|
if env["compiledb"]:
|
|
if env["compiledb"]:
|
|
if env.scons_version < (4, 0, 0):
|
|
if env.scons_version < (4, 0, 0):
|
|
# Generating the compilation DB (`compile_commands.json`) requires SCons 4.0.0 or later.
|
|
# Generating the compilation DB (`compile_commands.json`) requires SCons 4.0.0 or later.
|
|
- print_error("The `compiledb=yes` option requires SCons 4.0 or later, but your version is %s." % scons_raw_version)
|
|
|
|
|
|
+ print_error(
|
|
|
|
+ "The `compiledb=yes` option requires SCons 4.0 or later, but your version is %s." % scons_raw_version
|
|
|
|
+ )
|
|
Exit(255)
|
|
Exit(255)
|
|
|
|
|
|
env.Tool("compilation_db")
|
|
env.Tool("compilation_db")
|