Commit 77c3b043 authored by Guido Gunther's avatar Guido Gunther Committed by Guido Gunther

build: Detect if ld supports a version script

This is e.g. not the case for Clang on OSX.

Closes: #58
parent 50865a07
......@@ -113,9 +113,15 @@ libhandy_deps = [
cc.find_library('rt', required: false),
]
libhandy_link_args = []
libhandy_symbols_file = 'libhandy.syms'
libhandy_symbols_flag = '-Wl,--version-script,@0@/@1@'.format(meson.source_root(),
# Check linker flags
ld_version_script_arg = '-Wl,--version-script,@0@/@1@'.format(meson.source_root(),
libhandy_symbols_file)
if cc.links('int main() { return 0; }', args : ld_version_script_arg, name : 'ld_supports_version_script')
libhandy_link_args += [ld_version_script_arg]
endif
libhandy_args = []
libhandy = shared_library(
......@@ -127,7 +133,7 @@ libhandy = shared_library(
dependencies: libhandy_deps,
include_directories: [ root_inc, src_inc ],
install: true,
link_args: libhandy_symbols_flag,
link_args: libhandy_link_args,
)
libhandy_dep = declare_dependency(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment