[libnotify/wip/jtojnar/darwin-link] build: check supported linker flags before build



commit b0044ff99ca9b60943f413aa2e4b51dd39b1cdbc
Author: Jan Tojnar <jtojnar gmail com>
Date:   Fri Apr 26 20:07:10 2019 +0200

    build: check supported linker flags before build
    
    MacOS linker does not support --version-script option so we need
    to only add it to ldflags when it is available.

 libnotify/meson.build | 4 ++--
 meson.build           | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libnotify/meson.build b/libnotify/meson.build
index a2fb814..c1fb485 100644
--- a/libnotify/meson.build
+++ b/libnotify/meson.build
@@ -37,9 +37,9 @@ libnotify_cflags = [
 ]
 
 mapfile = meson.project_name() + '.map'
-libnotify_ldflags = [
+libnotify_ldflags = cc.get_supported_link_arguments([
   '-Wl,--version-script,'+join_paths(meson.current_source_dir(), mapfile),
-]
+])
 
 notify_dep = declare_dependency(
   include_directories: default_includes,
diff --git a/meson.build b/meson.build
index 8328a69..82f3bb5 100644
--- a/meson.build
+++ b/meson.build
@@ -6,6 +6,8 @@ project('libnotify',
 gnome = import('gnome')
 pkgconfig = import('pkgconfig')
 
+cc = meson.get_compiler('c')
+
 ################################################################
 # libtool versioning
 ################################################################


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]