summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build23
1 files changed, 15 insertions, 8 deletions
diff --git a/meson.build b/meson.build
index 65c6b98609e..f227bc3e018 100644
--- a/meson.build
+++ b/meson.build
@@ -503,11 +503,25 @@ endif
cpp = meson.get_compiler('cpp')
cpp_args = []
foreach a : ['-Wall', '-fno-math-errno', '-fno-trapping-math',
- '-Qunused-arguments', '-Wno-non-virtual-dtor']
+ '-Qunused-arguments']
if cpp.has_argument(a)
cpp_args += a
endif
endforeach
+
+# For some reason, the test for -Wno-foo always succeeds with gcc, even if the
+# option is not supported. Hence, check for -Wfoo instead.
+if cpp.has_argument('-Wnon-virtual-dtor')
+ cpp_args += '-Wno-non-virtual-dtor'
+endif
+
+no_override_init_args = []
+foreach a : ['override-init', 'initializer-overrides']
+ if cc.has_argument('-W' + a)
+ no_override_init_args += '-Wno-' + a
+ endif
+endforeach
+
cpp_vis_args = []
if cpp.has_argument('-fvisibility=hidden')
cpp_vis_args += '-fvisibility=hidden'
@@ -527,13 +541,6 @@ foreach a : ['-Werror=pointer-arith', '-Werror=vla']
endif
endforeach
-no_override_init_args = []
-foreach a : ['-Wno-override-init', '-Wno-initializer-overrides']
- if cc.has_argument(a)
- no_override_init_args += a
- endif
-endforeach
-
if host_machine.cpu_family().startswith('x86')
pre_args += '-DHAVE_SSE41'
with_sse41 = true