Skip to content

Commit

Permalink
meson: Conditionally test for linker flags
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ebassi committed Apr 25, 2018
1 parent 5fa7bf6 commit af76cd2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit af76cd2

Please sign in to comment.