mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-30 16:14:56 +02:00
Merge branch 'disable-ios-nsgetenviron' into 'master'
Various fixes when building for iOS See merge request GNOME/glib!1512
This commit is contained in:
commit
2ed356cb67
@ -90,6 +90,7 @@ endian = 'little'
|
|||||||
c_args = ['-I${prefix_path}/include']
|
c_args = ['-I${prefix_path}/include']
|
||||||
c_link_args = ['-L${prefix_path}/lib64',
|
c_link_args = ['-L${prefix_path}/lib64',
|
||||||
'-fuse-ld=gold']
|
'-fuse-ld=gold']
|
||||||
|
growing_stack = true
|
||||||
|
|
||||||
[binaries]
|
[binaries]
|
||||||
c = '${toolchain_path}/bin/${CC}'
|
c = '${toolchain_path}/bin/${CC}'
|
||||||
|
25
.gitlab-ci/cross_file_ios_example.txt
Normal file
25
.gitlab-ci/cross_file_ios_example.txt
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
[host_machine]
|
||||||
|
system = 'darwin'
|
||||||
|
cpu_family = 'aarch64'
|
||||||
|
cpu = 'arm64'
|
||||||
|
endian = 'little'
|
||||||
|
|
||||||
|
[properties]
|
||||||
|
c_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-miphoneos-version-min=11.0']
|
||||||
|
cpp_args = ['-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-miphoneos-version-min=11.0']
|
||||||
|
objc_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-miphoneos-version-min=11.0']
|
||||||
|
objcpp_args = ['-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-miphoneos-version-min=11.0']
|
||||||
|
c_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-Wl,-iphoneos_version_min,11.0']
|
||||||
|
cpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-Wl,-iphoneos_version_min,11.0']
|
||||||
|
objc_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-Wl,-iphoneos_version_min,11.0']
|
||||||
|
objcpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-Wl,-iphoneos_version_min,11.0']
|
||||||
|
growing_stack = true
|
||||||
|
|
||||||
|
|
||||||
|
[binaries]
|
||||||
|
c = ['clang']
|
||||||
|
cpp = ['clang++']
|
||||||
|
objc = ['clang']
|
||||||
|
objcpp = ['clang++']
|
||||||
|
ar = ['ar']
|
||||||
|
strip = ['strip']
|
19
meson.build
19
meson.build
@ -33,6 +33,16 @@ endif
|
|||||||
|
|
||||||
host_system = host_machine.system()
|
host_system = host_machine.system()
|
||||||
|
|
||||||
|
if host_system == 'darwin'
|
||||||
|
ios_test_code = '''#include <TargetConditionals.h>
|
||||||
|
#if ! TARGET_OS_IPHONE
|
||||||
|
#error "Not iOS/tvOS/watchOS/iPhoneSimulator"
|
||||||
|
#endif'''
|
||||||
|
if cc.compiles(ios_test_code, name : 'building for iOS')
|
||||||
|
host_system = 'ios'
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
glib_version = meson.project_version()
|
glib_version = meson.project_version()
|
||||||
glib_api_version = '2.0'
|
glib_api_version = '2.0'
|
||||||
version_arr = glib_version.split('.')
|
version_arr = glib_version.split('.')
|
||||||
@ -502,9 +512,14 @@ functions = [
|
|||||||
'wcslen',
|
'wcslen',
|
||||||
'wcsnlen',
|
'wcsnlen',
|
||||||
'sysctlbyname',
|
'sysctlbyname',
|
||||||
'_NSGetEnviron',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# _NSGetEnviron is available on iOS too, but its usage gets apps rejected from
|
||||||
|
# the app store since it's considered 'private API'
|
||||||
|
if host_system == 'darwin'
|
||||||
|
functions += ['_NSGetEnviron']
|
||||||
|
endif
|
||||||
|
|
||||||
if glib_conf.has('HAVE_SYS_STATVFS_H')
|
if glib_conf.has('HAVE_SYS_STATVFS_H')
|
||||||
functions += ['statvfs']
|
functions += ['statvfs']
|
||||||
else
|
else
|
||||||
@ -2142,7 +2157,7 @@ if host_system == 'windows'
|
|||||||
export_dynamic_ldflags = []
|
export_dynamic_ldflags = []
|
||||||
elif host_system == 'cygwin'
|
elif host_system == 'cygwin'
|
||||||
export_dynamic_ldflags = ['-Wl,--export-all-symbols']
|
export_dynamic_ldflags = ['-Wl,--export-all-symbols']
|
||||||
elif host_system == 'darwin'
|
elif host_system in ['darwin', 'ios']
|
||||||
export_dynamic_ldflags = []
|
export_dynamic_ldflags = []
|
||||||
elif host_system == 'sunos'
|
elif host_system == 'sunos'
|
||||||
export_dynamic_ldflags = []
|
export_dynamic_ldflags = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user