summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-27 10:05:41 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-27 10:05:41 -0400
commit2c5434ad3cbf7dfa8837083bcadbdc2b9a2bcaea (patch)
tree1e8d96b177bba390d45b39a82bf8dc89e3921412
parent9f0e9c0119c67bd960082d0350c32938f4fca967 (diff)
meson: fix detection of "-Wno-" options
-rw-r--r--meson.build15
1 files changed, 11 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index d9dfe7fbd9..fa0ef168f8 100644
--- a/meson.build
+++ b/meson.build
@@ -246,10 +246,6 @@ foreach arg : ['-Wundef',
'-Wendif-labels',
'-Wstrict-aliasing=2',
'-Wwrite-strings',
- '-Wno-unused-parameter',
- '-Wno-missing-field-initializers',
- '-Wno-unused-result',
- '-Wno-format-signedness',
'-Werror=overflow',
'-Wdate-time',
'-Wnested-externs',
@@ -268,6 +264,17 @@ foreach arg : ['-Wundef',
endif
endforeach
+# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
+# arguments, just emits a warnings. So test for the "positive" version instead.
+foreach arg : ['unused-parameter',
+ 'missing-field-initializers',
+ 'unused-result',
+ 'format-signedness']
+ if cc.has_argument('-W' + arg)
+ add_project_arguments('-Wno-' + arg, language : 'c')
+ endif
+endforeach
+
if cc.compiles('
#include <time.h>
#include <inttypes.h>