meson: make it trivial to add other -Wno-foo CFLAGS
authorEric Engestrom <eric.engestrom@intel.com>
Fri, 21 Sep 2018 10:37:53 +0000 (11:37 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Tue, 25 Sep 2018 10:39:56 +0000 (11:39 +0100)
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
meson.build

index d098f96d949fb9c03d1cef33de67a23589927852..c22ff4d9a8ae0b2191bb1993f0d8013bdbb39dbf 100644 (file)
@@ -789,9 +789,12 @@ foreach a : ['-Wall', '-Werror=implicit-function-declaration',
     c_args += a
   endif
 endforeach
-if cc.has_argument('-Wmissing-field-initializers')
-  c_args += '-Wno-missing-field-initializers'
-endif
+
+foreach a : ['missing-field-initializers']
+  if cc.has_argument('-W' + a)
+    c_args += '-Wno-' + a
+  endif
+endforeach
 
 c_vis_args = []
 if cc.has_argument('-fvisibility=hidden')