aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2018-04-12 16:43:03 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2018-04-25 11:37:44 +0100
commitaf76cd235d73c412f86bc0c523be88d4b13f353b (patch)
tree5bf649f07a4ad2e92e39ef6ca18219cebee2bca4
parent5fa7bf6e2790adc468eff5978c728dd9b6f855e4 (diff)
downloadlibepoxy-af76cd235d73c412f86bc0c523be88d4b13f353b.tar.gz
meson: Conditionally test for linker flags
Meson 0.46 introduced a function to check for linker flags passed to the compiler; since the version is really brand new, I don't want to bump the dependency on Meson just yet, so we're going to conditionally use get_supported_link_arguments() only if we're building with Meson 0.46 or later.
-rw-r--r--src/meson.build12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/meson.build b/src/meson.build
index 66e28c1..6208689 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -49,12 +49,12 @@ epoxy_sources = sources + gen_sources
common_ldflags = []
-if host_system == 'linux'
- foreach f: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
- if cc.has_argument(f)
- common_ldflags += f
- endif
- endforeach
+if host_system == 'linux' and cc.get_id() == 'gcc'
+ if meson.version().version_compare('>= 0.46.0')
+ common_ldflags += cc.get_supported_link_arguments([ '-Wl,-Bsymbolic', '-Wl,z,relro' ])
+ else
+ common_ldflags += [ '-Wl,-Bsymbolic', '-Wl,-z,relro', ]
+ endif
endif
# Maintain compatibility with autotools; see: https://github.com/anholt/libepoxy/issues/108