summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-03-27 16:04:26 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-03-30 18:28:51 +0200
commit72ea74bcc15e4a53f74e217ece0eea6d7aed04ad (patch)
tree0a254c59f7d58d6b17144c6dfaca4db0687df84c /SConstruct
parentf097511b96c7e93f0d62b1c2818208dc11c19851 (diff)
SCons: Treat all warnings as errors
After an effort spanning several years, we should now be warning-free on all major compilers, so we can set `-Werror` to ensure that we don't introduce warnings in new code. Disable -Werror=strict-overflow on GCC 7 though, as it seems bogus and was fixed in 8+.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct4
1 files changed, 3 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index 693137f77f..373fd098af 100644
--- a/SConstruct
+++ b/SConstruct
@@ -126,7 +126,7 @@ opts.Add(BoolVariable("xaudio2", "Enable the XAudio2 audio driver", False))
opts.Add(BoolVariable("verbose", "Enable verbose output for the compilation", False))
opts.Add(BoolVariable("progress", "Show a progress indicator during compilation", True))
opts.Add(EnumVariable("warnings", "Level of compilation warnings", "all", ("extra", "all", "moderate", "no")))
-opts.Add(BoolVariable("werror", "Treat compiler warnings as errors", False))
+opts.Add(BoolVariable("werror", "Treat compiler warnings as errors", True))
opts.Add(BoolVariable("dev", "If yes, alias for verbose=yes warnings=extra werror=yes", False))
opts.Add("extra_suffix", "Custom extra suffix added to the base filename of all generated binary files", "")
opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False))
@@ -448,6 +448,8 @@ if selected_platform in platform_list:
# FIXME: Temporary workaround after the Vulkan merge, remove once warnings are fixed.
if methods.using_gcc(env):
env.Append(CXXFLAGS=["-Wno-error=cpp"])
+ if cc_version_major == 7: # Bogus warning fixed in 8+.
+ env.Append(CCFLAGS=["-Wno-error=strict-overflow"])
else:
env.Append(CXXFLAGS=["-Wno-error=#warnings"])
else: # always enable those errors