package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

79 lines
2.8 KiB

commit 4e5cf4e3689c49d641c08245100c095c416c4f86
Author: Kelvin Zhang <zhangxp1998@gmail.com>
Date: Fri Dec 31 09:31:00 2021 -0800
Use meson dependency to link against apple framework
Using ld_flags would work, but that does not propagate ldflags to users
of glib. Meson's dependency() call will propagate apple framework
dependencies to downstream users.
diff --git a/gio/meson.build b/gio/meson.build
index 5e879fd3d..a22c822b0 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -390,6 +390,8 @@ if host_system != 'windows'
settings_sources += files('gnextstepsettingsbackend.m')
contenttype_sources += files('gosxcontenttype.m')
appinfo_sources += files('gosxappinfo.m')
+ framework_dep = dependency('appleframeworks', modules : ['Foundation', 'CoreFoundation', 'AppKit'])
+ platform_deps += [framework_dep]
if glib_have_os_x_9_or_later
unix_sources += files('gcocoanotificationbackend.m')
endif
diff --git a/glib/meson.build b/glib/meson.build
index f78f32969..13750dd83 100644
--- a/glib/meson.build
+++ b/glib/meson.build
@@ -310,6 +310,8 @@ glib_sources = files(
'gprintf.c',
)
+platform_deps = []
+
if host_system == 'windows'
glib_win_rc = configure_file(
input: 'glib.rc.in',
@@ -330,6 +332,13 @@ endif
if glib_have_cocoa
glib_sources += files('gosxutils.m')
+ framework_dep = dependency('appleframeworks', modules : ['Foundation', 'CoreFoundation', 'AppKit'])
+ platform_deps += [framework_dep]
+endif
+
+if glib_have_carbon
+ framework_dep = dependency('appleframeworks', modules : 'Carbon')
+ platform_deps += [framework_dep]
endif
glib_sources += files('gthread-@0@.c'.format(threads_implementation))
diff --git a/meson.build b/meson.build
index 9d1b76c56..f780fa82e 100644
--- a/meson.build
+++ b/meson.build
@@ -769,8 +769,6 @@ if host_system == 'darwin'
add_project_arguments(objcc.get_supported_arguments(warning_objc_args), language: 'objc')
- osx_ldflags += ['-Wl,-framework,CoreFoundation']
-
# Mac OS X Carbon support
glib_have_carbon = objcc.compiles('''#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>''',
@@ -778,7 +776,6 @@ if host_system == 'darwin'
if glib_have_carbon
glib_conf.set('HAVE_CARBON', true)
- osx_ldflags += '-Wl,-framework,Carbon'
glib_have_os_x_9_or_later = objcc.compiles('''#include <AvailabilityMacros.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
#error Compiling for minimum OS X version before 10.9
@@ -795,7 +792,6 @@ if host_system == 'darwin'
if glib_have_cocoa
glib_conf.set('HAVE_COCOA', true)
- osx_ldflags += ['-Wl,-framework,Foundation', '-Wl,-framework,AppKit']
endif
# FIXME: libgio mix C and objC source files and there is no way to reliably