Meson: Add carbon and cocoa flags into glib and gio pc files

https://bugzilla.gnome.org/show_bug.cgi?id=788773
This commit is contained in:
Xavier Claessens 2018-01-04 15:55:59 -05:00
parent 3c76114e73
commit dad4f956c5
3 changed files with 8 additions and 10 deletions

View File

@ -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,

View File

@ -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')),

View File

@ -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 <Carbon/Carbon.h>
@ -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 <AvailabilityMacros.h>
#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 <Cocoa/Cocoa.h>
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 <linux/futex.h>
#include <sys/syscall.h>