summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-09-05 14:36:20 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-09-08 17:06:51 +0200
commitc4614fedd97e0aea3095fac6d66eb977d35f7e42 (patch)
treee38bc508ae3d83bb8bad797cfe7248bf2b2e0bb6 /meson.build
parent678f1d60e98cb76d2e59b3a6e31f26e353453a63 (diff)
meson: detect cc flags
Somehow my gcc has a different idea of what no-implicit-fallthrough should look like than the one Eric used. Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build22
1 files changed, 14 insertions, 8 deletions
diff --git a/meson.build b/meson.build
index 4d6985d1..39749a0e 100644
--- a/meson.build
+++ b/meson.build
@@ -8,16 +8,22 @@ project('IGT gpu tests', 'c',
cc = meson.get_compiler('c')
-add_global_arguments('-Wno-unused-parameter', language: 'c')
-add_global_arguments('-Wno-sign-compare', language: 'c')
-add_global_arguments('-Wno-missing-field-initializers', language: 'c')
-add_global_arguments('-Wno-clobbered', language: 'c')
-
+cc_args = [
+ '-Wno-unused-parameter',
+ '-Wno-sign-compare',
+ '-Wno-missing-field-initializers',
+ '-Wno-clobbered',
# Macros asserting on the range of their arguments triggers this.
-add_global_arguments('-Wno-type-limits', language: 'c')
-
+ '-Wno-type-limits',
# igt_assert(0) in switch statements triggers a bunch of this.
-add_global_arguments('-Wimplicit-fallthrough=0', language: 'c')
+ '-Wimplicit-fallthrough=0',
+]
+
+foreach cc_arg : cc_args
+ if cc.has_argument(cc_arg)
+ add_global_arguments(cc_arg, language : 'c')
+ endif
+endforeach
inc = include_directories('lib', '.')