build: check supported linker args before build

MacOS linker does not support --version-script argument so we need
to only add it to ldflags when it is available.
This commit is contained in:
Jan Tojnar 2019-04-26 20:07:10 +02:00
parent 44f9222212
commit 55eb69247f
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
2 changed files with 4 additions and 2 deletions

View File

@ -37,9 +37,9 @@ libnotify_cflags = [
] ]
mapfile = meson.project_name() + '.map' mapfile = meson.project_name() + '.map'
libnotify_ldflags = [ libnotify_ldflags = cc.get_supported_link_arguments([
'-Wl,--version-script,'+join_paths(meson.current_source_dir(), mapfile), '-Wl,--version-script,'+join_paths(meson.current_source_dir(), mapfile),
] ])
notify_dep = declare_dependency( notify_dep = declare_dependency(
include_directories: default_includes, include_directories: default_includes,

View File

@ -6,6 +6,8 @@ project('libnotify',
gnome = import('gnome') gnome = import('gnome')
pkgconfig = import('pkgconfig') pkgconfig = import('pkgconfig')
cc = meson.get_compiler('c')
################################################################ ################################################################
# libtool versioning # libtool versioning
################################################################ ################################################################