640d1c2d71f0fe3f4b732cdcee099d880c27a310 — Martin Kühl 7 months ago c0cbd23
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 @@ 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