summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2018-06-19 14:41:04 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2018-06-19 14:49:02 +0100
commit3ab86657041d46d32eb7cd2b8791bb2c8d6160a6 (patch)
treefc639936c86ea8be3330cf6964139e7c9d161318
parent785e609e38a90123abf47eb15c9923ad68114e6a (diff)
downloadatk-3ab86657041d46d32eb7cd2b8791bb2c8d6160a6.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