aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-07-06 10:34:56 +0200
committerDavid Robillard <d@drobilla.net>2020-07-06 11:03:55 +0200
commit9934934a070b138c9ff11dd821a755020c39eefa (patch)
treee48086ef31ce22d2933d3299ce6d54ebd128823e /wscript
parent9f17e7498c9527c85e292914f7e874c045dccc75 (diff)
downloadserd-9934934a070b138c9ff11dd821a755020c39eefa.tar.gz
serd-9934934a070b138c9ff11dd821a755020c39eefa.tar.bz2
serd-9934934a070b138c9ff11dd821a755020c39eefa.zip
Update autowaf and be explicit about warning flags
Diffstat (limited to 'wscript')
-rw-r--r--wscript47
1 files changed, 44 insertions, 3 deletions
diff --git a/wscript b/wscript
index ff20477b..b5e9c10a 100644
--- a/wscript
+++ b/wscript
@@ -44,14 +44,55 @@ def configure(conf):
conf.load('autowaf', cache=True)
autowaf.set_c_lang(conf, 'c99')
- if Options.options.strict and not conf.env.MSVC_COMPILER:
- conf.env.append_unique('CFLAGS', '-Wno-cast-align')
-
+ if Options.options.strict:
# Check for programs used by lint target
conf.find_program("flake8", var="FLAKE8", mandatory=False)
conf.find_program("clang-tidy", var="CLANG_TIDY", mandatory=False)
conf.find_program("iwyu_tool", var="IWYU_TOOL", mandatory=False)
+ if Options.options.ultra_strict:
+ autowaf.add_compiler_flags(conf.env, '*', {
+ 'clang': [
+ '-Wno-cast-align',
+ '-Wno-cast-qual',
+ '-Wno-covered-switch-default',
+ '-Wno-double-promotion',
+ '-Wno-format-nonliteral',
+ '-Wno-implicit-fallthrough',
+ '-Wno-padded',
+ '-Wno-reserved-id-macro',
+ '-Wno-sign-conversion',
+ '-Wno-switch-enum',
+ ],
+ 'gcc': [
+ '-Wno-cast-align',
+ '-Wno-cast-qual',
+ '-Wno-padded',
+ '-Wno-sign-conversion',
+ '-Wno-switch-enum',
+ ],
+ 'msvc': [
+ '/wd4061', # enumerator in switch is not explicitly handled
+ '/wd4365', # signed/unsigned mismatch
+ '/wd4514', # unreferenced inline function has been removed
+ '/wd4820', # padding added after construct
+ '/wd4996', # POSIX name for this item is deprecated
+ ],
+ })
+
+ autowaf.add_compiler_flags(conf.env, 'c', {
+ 'clang': [
+ '-Wno-bad-function-cast',
+ ],
+ 'gcc': [
+ '-Wno-bad-function-cast',
+ ],
+ 'msvc': [
+ '/wd4706', # assignment within conditional expression
+ '/wd5045', # will insert Spectre mitigation for memory load
+ ],
+ })
+
conf.env.update({
'BUILD_UTILS': not Options.options.no_utils,
'BUILD_SHARED': not Options.options.no_shared,