From 2c5434ad3cbf7dfa8837083bcadbdc2b9a2bcaea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 27 Apr 2017 10:05:41 -0400 Subject: meson: fix detection of "-Wno-" options --- meson.build | 15 +++++++++++---- 1 file 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 #include -- cgit v1.2.3