mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00
build_ios_libs.py: Allow customizing the deployment target
Previously, this script hardcoded deployment targets for device, simulator, and Catalyst builds. This commit turns those into minimums and allows callers to pass a higher version with --deployment-target. Bug: None Change-Id: I9398a8466dfa35ebac5e198aef6ec4f521054cc6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314420 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40506}
This commit is contained in:
parent
c570368abc
commit
c633ce731a
1 changed files with 18 additions and 6 deletions
|
@ -39,10 +39,9 @@ ENABLED_ARCHS = [
|
||||||
DEFAULT_ARCHS = [
|
DEFAULT_ARCHS = [
|
||||||
'device:arm64', 'simulator:arm64', 'simulator:x64'
|
'device:arm64', 'simulator:arm64', 'simulator:x64'
|
||||||
]
|
]
|
||||||
IOS_DEPLOYMENT_TARGET = {
|
IOS_MINIMUM_DEPLOYMENT_TARGET = {
|
||||||
# RingRTC change to control iOS targets
|
'device': '12.0',
|
||||||
'device': '11.0',
|
'simulator': '12.0',
|
||||||
'simulator': '11.0',
|
|
||||||
'catalyst': '14.0'
|
'catalyst': '14.0'
|
||||||
}
|
}
|
||||||
LIBVPX_BUILD_VP9 = False
|
LIBVPX_BUILD_VP9 = False
|
||||||
|
@ -100,6 +99,11 @@ def _ParseArgs():
|
||||||
action='store_true',
|
action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
help='Use RBE to build.')
|
help='Use RBE to build.')
|
||||||
|
parser.add_argument('--deployment-target',
|
||||||
|
default=IOS_MINIMUM_DEPLOYMENT_TARGET['device'],
|
||||||
|
help='Raise the minimum deployment target to build for. '
|
||||||
|
'Cannot be lowered below 12.0 for iOS/iPadOS '
|
||||||
|
'and 14.0 for Catalyst.')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--extra-gn-args',
|
'--extra-gn-args',
|
||||||
default=[],
|
default=[],
|
||||||
|
@ -152,6 +156,12 @@ def _ParseArchitecture(architectures):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def _VersionMax(*versions):
|
||||||
|
return max(
|
||||||
|
*versions,
|
||||||
|
key=lambda version: [int(component) for component in version.split('.')])
|
||||||
|
|
||||||
|
|
||||||
def BuildWebRTC(output_dir, target_environment, target_arch, flavor,
|
def BuildWebRTC(output_dir, target_environment, target_arch, flavor,
|
||||||
gn_target_name, ios_deployment_target, libvpx_build_vp9,
|
gn_target_name, ios_deployment_target, libvpx_build_vp9,
|
||||||
use_goma, use_remoteexec, extra_gn_args):
|
use_goma, use_remoteexec, extra_gn_args):
|
||||||
|
@ -235,6 +245,8 @@ def main():
|
||||||
framework_paths = []
|
framework_paths = []
|
||||||
all_lib_paths = []
|
all_lib_paths = []
|
||||||
for (environment, archs) in list(architectures.items()):
|
for (environment, archs) in list(architectures.items()):
|
||||||
|
ios_deployment_target = _VersionMax(
|
||||||
|
args.deployment_target, IOS_MINIMUM_DEPLOYMENT_TARGET[environment])
|
||||||
framework_path = os.path.join(args.output_dir, environment)
|
framework_path = os.path.join(args.output_dir, environment)
|
||||||
framework_paths.append(framework_path)
|
framework_paths.append(framework_path)
|
||||||
lib_paths = []
|
lib_paths = []
|
||||||
|
@ -242,8 +254,8 @@ def main():
|
||||||
lib_path = os.path.join(framework_path, arch + '_libs')
|
lib_path = os.path.join(framework_path, arch + '_libs')
|
||||||
lib_paths.append(lib_path)
|
lib_paths.append(lib_path)
|
||||||
BuildWebRTC(lib_path, environment, arch, args.build_config,
|
BuildWebRTC(lib_path, environment, arch, args.build_config,
|
||||||
gn_target_name, IOS_DEPLOYMENT_TARGET[environment],
|
gn_target_name, ios_deployment_target, LIBVPX_BUILD_VP9,
|
||||||
LIBVPX_BUILD_VP9, args.use_goma, args.use_remoteexec, gn_args)
|
args.use_goma, args.use_remoteexec, gn_args)
|
||||||
all_lib_paths.extend(lib_paths)
|
all_lib_paths.extend(lib_paths)
|
||||||
|
|
||||||
# Combine the slices.
|
# Combine the slices.
|
||||||
|
|
Loading…
Reference in a new issue