From dad4f956c576a6f4234f3228b07679dcd7d37550 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 4 Jan 2018 15:55:59 -0500 Subject: [PATCH] Meson: Add carbon and cocoa flags into glib and gio pc files https://bugzilla.gnome.org/show_bug.cgi?id=788773 --- gio/meson.build | 1 + glib/meson.build | 3 ++- meson.build | 14 +++++--------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/gio/meson.build b/gio/meson.build index 280737559..44808f77e 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -800,6 +800,7 @@ if giomodulesdir == '' endif pkg.generate(libraries : libgio, + libraries_private : [osx_ldflags], requires : ['glib-2.0', 'gobject-2.0'], variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')), 'giomoduledir=' + giomodulesdir, diff --git a/glib/meson.build b/glib/meson.build index 3b4caf8ce..9d186201d 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -234,7 +234,7 @@ libglib = library('glib-2.0', soversion : soversion, install : true, # intl.lib is not compatible with SAFESEH - link_args : platform_ldflags + noseh_link_args, + link_args : noseh_link_args, include_directories : configinc, link_with : [charset_lib, gnulib_lib], dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps, @@ -250,6 +250,7 @@ libglib_dep = declare_dependency( include_directories : [configinc, glibinc]) pkg.generate(libraries : libglib, + libraries_private : [osx_ldflags], subdirs : ['glib-2.0'], extra_cflags : ['-I${libdir}/glib-2.0/include'], variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')), diff --git a/meson.build b/meson.build index 8e73a0811..4974a51bd 100644 --- a/meson.build +++ b/meson.build @@ -551,7 +551,7 @@ if host_system == 'linux' endif endif -platform_ldflags=[] +osx_ldflags = [] # Mac OS X Carbon support glib_have_carbon = cc.compiles('''#include @@ -562,14 +562,11 @@ glib_have_os_x_9_or_later = false if glib_have_carbon glib_conf.set('HAVE_CARBON', true) - CARBON_LIBS='-Wl,-framework,Carbon' # FIXME: propagate to .pc files as well - platform_ldflags += [CARBON_LIBS] + osx_ldflags += '-Wl,-framework,Carbon' glib_have_os_x_9_or_later = cc.compiles('''#include #if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 #error Compiling for minimum OS X version before 10.9 #endif''', name : 'OS X 9 or later') -else - CARBON_LIBS='' endif # Mac OS X Cocoa support @@ -581,12 +578,11 @@ glib_have_cocoa = cc.compiles('''#include if glib_have_cocoa glib_conf.set('HAVE_COCOA', true) - COCOA_LIBS='-Wl,-framework,Foundation -Wl,-framework,AppKit' # FIXME: propagate to .pc files as well - platform_ldflags += [COCOA_LIBS] -else - COCOA_LIBS='' + osx_ldflags += '-Wl,-framework,Foundation -Wl,-framework,AppKit' endif +add_project_link_arguments(osx_ldflags, language : 'c') + # Check for futex(2) if cc.links('''#include #include