Cross files for macOS and iOS architectures

This commit is contained in:
Chris Cannam
2021-02-10 14:24:17 +00:00
parent 2b06851c75
commit 0c38a07faf
5 changed files with 101 additions and 9 deletions

19
cross/ios-simulator.txt Normal file
View File

@@ -0,0 +1,19 @@
[constants]
sysroot = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk'
common_args = [ '-isysroot', sysroot, '-arch', 'x86_64', '-mios-version-min=8' ]
[host_machine]
cpu_family = 'x86_64'
cpu = 'x86_64'
system = 'darwin'
endian = 'little'
[binaries]
c = 'cc'
cpp = 'c++'
strip = 'strip'
[built-in options]
c_args = common_args
cpp_args = common_args + [ '-stdlib=libc++' ]
cpp_link_args = cpp_args

20
cross/ios.txt Normal file
View File

@@ -0,0 +1,20 @@
[constants]
sysroot = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk'
common_args = [ '-isysroot', sysroot, '-arch', 'arm64', '-arch', 'armv7', '-mios-version-min=8' ]
[host_machine]
cpu_family = 'aarch64'
cpu = 'aarch64'
system = 'darwin'
endian = 'little'
[binaries]
c = 'cc'
cpp = 'c++'
strip = 'strip'
[built-in options]
b_bitcode = true
c_args = common_args
cpp_args = common_args + [ '-stdlib=libc++' ]
cpp_link_args = cpp_args

20
cross/macos-arm64.txt Normal file
View File

@@ -0,0 +1,20 @@
[host_machine]
cpu_family = 'aarch64'
cpu = 'aarch64'
system = 'darwin'
endian = 'little'
[properties]
needs_exe_wrapper = false
[binaries]
c = 'cc'
cpp = 'c++'
strip = 'strip'
[built-in options]
c_args = ['-arch', 'arm64']
cpp_args = ['-arch', 'arm64']
cpp_link_args = ['-arch', 'arm64']

19
cross/macos-x86_64.txt Normal file
View File

@@ -0,0 +1,19 @@
[host_machine]
cpu_family = 'x86_64'
cpu = 'x86_64'
system = 'darwin'
endian = 'little'
[properties]
needs_exe_wrapper = false
[binaries]
c = 'cc'
cpp = 'c++'
strip = 'strip'
[built-in options]
c_args = ['-arch', 'x86_64']
cpp_args = ['-arch', 'x86_64']
cpp_link_args = ['-arch', 'x86_64']

View File

@@ -295,19 +295,32 @@ if system == 'darwin'
vamp_symbol_args += [ vamp_symbol_args += [
'-exported_symbols_list', meson.source_root() / 'vamp/vamp-plugin.list' '-exported_symbols_list', meson.source_root() / 'vamp/vamp-plugin.list'
] ]
have_version_min = false
foreach arg: get_option('cpp_args')
message('arg is ' + arg)
if arg.contains('version-min')
have_version_min = true
endif
endforeach
if architecture == 'aarch64' if architecture == 'aarch64'
config_summary += { 'Architecture': 'ARM (macOS 11 or newer)' } mac_platform_arguments = [
arch_flags = [ '-arch', 'arm64',
'-mmacosx-version-min=11',
'-arch', 'arm64'
] ]
if not have_version_min
mac_platform_arguments += [ '-mmacosx-version-min=11' ]
endif
elif architecture == 'x86_64' elif architecture == 'x86_64'
config_summary += { 'Architecture': 'Intel (macOS 10.11 or newer)' } mac_platform_arguments = [
arch_flags = [
'-mmacosx-version-min=10.11',
'-arch', 'x86_64', '-arch', 'x86_64',
] ]
endif # architecture if not have_version_min
mac_platform_arguments += [ '-mmacosx-version-min=10.13' ]
endif
else # begin architecture != 'aarch64' or 'x86_64'
error('Build for architecture ' + architecture + ' is not supported on this platform')
endif # end architecture
elif system == 'windows' elif system == 'windows'
if cpp.get_id() == 'msvc' if cpp.get_id() == 'msvc'
@@ -506,5 +519,6 @@ summary({'prefix': get_option('prefix'),
'datadir': get_option('datadir'), 'datadir': get_option('datadir'),
}, section: 'Directories') }, section: 'Directories')
summary(config_summary, section: 'Configuration', bool_yn: true) summary(config_summary + { 'Architecture': architecture },
section: 'Configuration', bool_yn: true)
summary(target_summary, section: 'Build targets', bool_yn: true) summary(target_summary, section: 'Build targets', bool_yn: true)