iOS
This commit is contained in:
parent
44a8963c50
commit
51dcd3209d
|
@ -14,6 +14,7 @@ class ApplePlatformInfo(PlatformInfo):
|
||||||
target = None
|
target = None
|
||||||
sdk_name = None
|
sdk_name = None
|
||||||
min_iphoneos_version = None
|
min_iphoneos_version = None
|
||||||
|
min_macos_version = None
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
@ -40,14 +41,12 @@ class ApplePlatformInfo(PlatformInfo):
|
||||||
'binaries': self.binaries,
|
'binaries': self.binaries,
|
||||||
'exe_wrapper_def': '',
|
'exe_wrapper_def': '',
|
||||||
'extra_libs': [
|
'extra_libs': [
|
||||||
'-fembed-bitcode',
|
|
||||||
'-isysroot', self.root_path,
|
'-isysroot', self.root_path,
|
||||||
'-arch', self.arch,
|
'-arch', self.arch,
|
||||||
'-target', self.target,
|
'-target', self.target,
|
||||||
'-stdlib=libc++'
|
'-stdlib=libc++'
|
||||||
],
|
],
|
||||||
'extra_cflags': [
|
'extra_cflags': [
|
||||||
'-fembed-bitcode',
|
|
||||||
'-isysroot', self.root_path,
|
'-isysroot', self.root_path,
|
||||||
'-arch', self.arch,
|
'-arch', self.arch,
|
||||||
'-target', self.target,
|
'-target', self.target,
|
||||||
|
@ -66,24 +65,31 @@ class ApplePlatformInfo(PlatformInfo):
|
||||||
if self.min_iphoneos_version:
|
if self.min_iphoneos_version:
|
||||||
config['extra_libs'].append('-miphoneos-version-min={}'.format(self.min_iphoneos_version))
|
config['extra_libs'].append('-miphoneos-version-min={}'.format(self.min_iphoneos_version))
|
||||||
config['extra_cflags'].append('-miphoneos-version-min={}'.format(self.min_iphoneos_version))
|
config['extra_cflags'].append('-miphoneos-version-min={}'.format(self.min_iphoneos_version))
|
||||||
|
if self.min_macos_version:
|
||||||
|
config['extra_libs'].append('-mmacosx-version-min={}'.format(self.min_macos_version))
|
||||||
|
config['extra_cflags'].append('-mmacosx-version-min={}'.format(self.min_macos_version))
|
||||||
return config
|
return config
|
||||||
|
|
||||||
def get_env(self):
|
def get_env(self):
|
||||||
env = super().get_env()
|
env = super().get_env()
|
||||||
env['MACOSX_DEPLOYMENT_TARGET'] = '10.15'
|
cflags = [env['CFLAGS']]
|
||||||
|
if self.min_iphoneos_version:
|
||||||
|
cflags.append('-miphoneos-version-min={}'.format(self.min_iphoneos_version))
|
||||||
|
if self.min_macos_version:
|
||||||
|
cflags.append('-mmacosx-version-min={}'.format(self.min_macos_version))
|
||||||
|
env['CFLAGS'] = ' '.join(cflags)
|
||||||
return env
|
return env
|
||||||
|
|
||||||
def set_comp_flags(self, env):
|
def set_comp_flags(self, env):
|
||||||
super().set_comp_flags(env)
|
super().set_comp_flags(env)
|
||||||
cflags = [
|
cflags = [
|
||||||
'-fembed-bitcode',
|
|
||||||
'-isysroot {}'.format(self.root_path),
|
'-isysroot {}'.format(self.root_path),
|
||||||
'-arch {}'.format(self.arch),
|
'-arch {}'.format(self.arch),
|
||||||
'-target {}'.format(self.target),
|
'-target {}'.format(self.target),
|
||||||
env['CFLAGS'],
|
env['CFLAGS'],
|
||||||
]
|
]
|
||||||
if self.min_iphoneos_version:
|
env['CC'] = 'clang'
|
||||||
cflags.append('-miphoneos-version-min={}'.format(self.min_iphoneos_version))
|
env['CXX'] = 'clang++'
|
||||||
env['CFLAGS'] = ' '.join(cflags)
|
env['CFLAGS'] = ' '.join(cflags)
|
||||||
env['CXXFLAGS'] = ' '.join([
|
env['CXXFLAGS'] = ' '.join([
|
||||||
env['CFLAGS'],
|
env['CFLAGS'],
|
||||||
|
@ -120,54 +126,53 @@ class iOSArm64(ApplePlatformInfo):
|
||||||
name = 'iOS_arm64'
|
name = 'iOS_arm64'
|
||||||
arch = cpu = 'arm64'
|
arch = cpu = 'arm64'
|
||||||
host = 'arm-apple-darwin'
|
host = 'arm-apple-darwin'
|
||||||
target = 'aarch64-apple-ios'
|
target = 'arm64-apple-ios'
|
||||||
sdk_name = 'iphoneos'
|
sdk_name = 'iphoneos'
|
||||||
min_iphoneos_version = '13.0'
|
min_iphoneos_version = '15.0'
|
||||||
|
|
||||||
|
|
||||||
class iOSx64(ApplePlatformInfo):
|
class iOSSimulatorX86(ApplePlatformInfo):
|
||||||
name = 'iOS_x86_64'
|
"""iOS / iPadOS simulator on Intel"""
|
||||||
|
|
||||||
|
name = 'iOS_simulator_x86'
|
||||||
arch = cpu = 'x86_64'
|
arch = cpu = 'x86_64'
|
||||||
host = 'x86_64-apple-darwin'
|
host = 'x86_64-apple-darwin'
|
||||||
target = 'x86_64-apple-ios'
|
target = 'x86_64-apple-ios'
|
||||||
sdk_name = 'iphonesimulator'
|
sdk_name = 'iphonesimulator'
|
||||||
min_iphoneos_version = '13.0'
|
min_iphoneos_version = '15.0'
|
||||||
|
|
||||||
|
|
||||||
class iOSMacABI(ApplePlatformInfo):
|
class iOSSimulatorArm64(ApplePlatformInfo):
|
||||||
name = 'iOS_Mac_ABI'
|
"""iOS / iPadOS simulator on Apple Silicon"""
|
||||||
arch = cpu = 'x86_64'
|
|
||||||
host = 'x86_64-apple-darwin'
|
name = 'iOS_simulator_arm64'
|
||||||
target = 'x86_64-apple-ios14.0-macabi'
|
arch = cpu = 'arm64'
|
||||||
sdk_name = 'macosx'
|
host = 'arm-apple-darwin'
|
||||||
min_iphoneos_version = '14.0'
|
target = 'arm64-apple-ios-simulator'
|
||||||
|
sdk_name = 'iphonesimulator'
|
||||||
|
min_iphoneos_version = '15.0'
|
||||||
|
|
||||||
|
|
||||||
class macOSArm64(ApplePlatformInfo):
|
class macOSArm64(ApplePlatformInfo):
|
||||||
name = 'macOS_arm64_static'
|
"""macOS on Apple Silicon"""
|
||||||
|
|
||||||
|
name = 'macOS_arm64'
|
||||||
arch = cpu = 'arm64'
|
arch = cpu = 'arm64'
|
||||||
host = 'aarch64-apple-darwin'
|
host = 'arm-apple-darwin'
|
||||||
target = 'arm64-apple-macos11'
|
target = 'arm64-apple-macos'
|
||||||
sdk_name = 'macosx'
|
sdk_name = 'macosx'
|
||||||
min_iphoneos_version = None
|
min_macos_version = '12.0'
|
||||||
|
|
||||||
|
|
||||||
class macOSArm64Mixed(MixedMixin('macOS_arm64_static'), ApplePlatformInfo):
|
class macOSX86(ApplePlatformInfo):
|
||||||
name = 'macOS_arm64_mixed'
|
"""macOS on Intel"""
|
||||||
arch = cpu = 'arm64'
|
|
||||||
host = 'aarch64-apple-darwin'
|
|
||||||
target = 'arm64-apple-macos11'
|
|
||||||
sdk_name = 'macosx'
|
|
||||||
min_iphoneos_version = None
|
|
||||||
|
|
||||||
|
name = 'macOS_x86'
|
||||||
class macOSx64(ApplePlatformInfo):
|
|
||||||
name = 'macOS_x86_64'
|
|
||||||
arch = cpu = 'x86_64'
|
arch = cpu = 'x86_64'
|
||||||
host = 'x86_64-apple-darwin'
|
host = 'x86_64-apple-darwin'
|
||||||
target = 'x86_64-apple-macos10.12'
|
target = 'x86_64-apple-macos'
|
||||||
sdk_name = 'macosx'
|
sdk_name = 'macosx'
|
||||||
min_iphoneos_version = None
|
min_macos_version = '12.0'
|
||||||
|
|
||||||
|
|
||||||
class IOS(MetaPlatformInfo):
|
class IOS(MetaPlatformInfo):
|
||||||
|
|
Loading…
Reference in New Issue