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.
macos/v1.5.9
Emmanuele Bassi 7 years ago
parent 5fa7bf6e27
commit af76cd235d
  1. 12
      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

Loading…
Cancel
Save