9951bc401a5147b81526db9cc3aa3b8b79f5e25d — Martin Kühl 10 months ago 00bfcdc
Support clang linker using -exported_symbols_list

Detection for `-exported_symbol` doesn't work,
and it doesn't accept wildcards anyway.
Use `-exported_symbols_list`, which works and is documented.

Fixes #78
2 files changed, 4 insertions(+), 2 deletions(-)

A libmrsh.clang.sym
M meson.build
A libmrsh.clang.sym => libmrsh.clang.sym +1 -0
@@ 0,0 1,1 @@
+_mrsh_*

M meson.build => meson.build +3 -2
@@ 40,10 40,11 @@ mrsh_inc = include_directories('include')
 install_subdir('include/mrsh', install_dir: get_option('includedir'))
 
 libmrsh_sym_path = meson.current_source_dir() + '/libmrsh.sym'
+libmrsh_clang_sym_path = meson.current_source_dir() + '/libmrsh.clang.sym'
 if cc.has_link_argument('-Wl,--version-script=' + libmrsh_sym_path) # GNU ld
 	link_args = ['-Wl,--version-script=' + libmrsh_sym_path]
-elif cc.has_link_argument('-Wl,-exported_symbol') # macOS
-	link_args = ['-Wl,-exported_symbol', 'mrsh_*']
+elif cc.has_multi_link_arguments('-Wl,-exported_symbols_list', libmrsh_clang_sym_path) # clang
+	link_args = ['-Wl,-exported_symbols_list', libmrsh_clang_sym_path]
 else
 	error('Linker doesn\'t support --version-script or -exported_symbol')
 endif