summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2018-06-19 14:41:04 +0100
committerAlejandro PiƱeiro <apinheiro@igalia.com>2019-03-09 11:58:15 +0100
commit7d0b258be2130f1ec420ae586d51cc0b497f5044 (patch)
treefc639936c86ea8be3330cf6964139e7c9d161318
parente1dd2f16db10abbacc575aa2d6c0b253bbd7efac (diff)
downloadatk-7d0b258be2130f1ec420ae586d51cc0b497f5044.tar.gz
build: Use Meson to test for compiler and linker arguments
Instead of iterating over them ourselves, Meson 0.46 provides useful convenience functions. Using the appropriate Meson functions also removes warnings with newer versions of Meson.
-rw-r--r--meson.build13
1 files changed, 3 insertions, 10 deletions
diff --git a/meson.build b/meson.build
index 5f68bcf..c7512e0 100644
--- a/meson.build
+++ b/meson.build
@@ -65,19 +65,12 @@ if get_option('default_library') != 'static'
endif
# Check all compiler flags
-foreach cflag: test_cflags
- if cc.has_argument(cflag)
- common_cflags += [ cflag ]
- endif
-endforeach
+common_cflags += cc.get_supported_arguments(test_cflags)
# Linker flags
if host_machine.system() == 'linux'
- foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
- if cc.has_argument(ldflag)
- common_ldflags += [ ldflag ]
- endif
- endforeach
+ test_ldflags = [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
+ common_ldflags += cc.get_supported_link_arguments(test_ldflags)
endif
# Maintain compatibility with autotools on macOS