meson: add carbon and cocoa libs when building for OSX

https://bugzilla.gnome.org/show_bug.cgi?id=791460
This commit is contained in:
Havard Graff 2017-12-11 12:32:57 +11:00 committed by Nirbheek Chauhan
parent db7c1180b3
commit 17bfc39ea7
2 changed files with 5 additions and 1 deletions

View File

@ -227,7 +227,7 @@ libglib = shared_library('glib-2.0',
soversion : soversion,
install : true,
# intl.lib is not compatible with SAFESEH
link_args : noseh_link_args,
link_args : platform_ldflags + noseh_link_args,
include_directories : configinc,
link_with : [charset_lib, gnulib_lib],
dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps,

View File

@ -459,6 +459,8 @@ if host_system == 'linux'
endif
endif
platform_ldflags=[]
# Mac OS X Carbon support
glib_have_carbon = cc.compiles('''#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>''',
@ -469,6 +471,7 @@ 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]
glib_have_os_x_9_or_later = cc.compiles('''#include <AvailabilityMacros.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
#error Compiling for minimum OS X version before 10.9
@ -487,6 +490,7 @@ glib_have_cocoa = cc.compiles('''#include <Cocoa/Cocoa.h>
if glib_have_cocoa
glib_conf.set('HAVE_COCOA', true)
COCOA_LIBS='-Wl,-framework,Foundation' # FIXME: propagate to .pc files as well
platform_ldflags += [COCOA_LIBS]
else
COCOA_LIBS=''
endif