Fix setup for iOS simulator on arm64 Macs.

The current setup for the iOS simulator keys off of the fact that iOS
runs on ARM CPUs, and Macs (prior to M1) ran on x64 CPUs. So setting
the target_os to "ios" and the target_cpu to "x64" will indicate use
of the simulator. On M1, they have the same CPU architecture, so we
need another method to indicate use of the simulator SDK.

Also added a check to disable code signing, which is not needed for
running on the simulator.

Bug: skia:12880
Change-Id: I668121010cc557546c4a4e4960601a732bb985c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526017
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
Jim Van Verth 2022-03-30 15:07:56 -04:00 committed by SkCQ
parent d370e89353
commit 0361abf39d
3 changed files with 5 additions and 3 deletions

View File

@ -31,6 +31,8 @@ declare_args() {
clang_win_version = ""
ios_min_target = ""
ios_use_simulator =
target_os == "ios" && (target_cpu == "x86" || target_cpu == "x64")
}
declare_args() {
is_debug = !is_official_build

View File

@ -214,7 +214,7 @@ if (is_ios) {
}
# should only code sign when running on a device, not the simulator
if (target_cpu != "x64") {
if (!ios_use_simulator) {
code_signing_script = "//gn/codesign_ios.py"
code_signing_sources = [ "$target_gen_dir/$app_name" ]
code_signing_outputs = [

View File

@ -25,12 +25,12 @@ declare_args() {
if (is_ios && xcode_sysroot == "") {
if (is_tvos) {
sdk = "appletvos"
if (target_cpu == "x86" || target_cpu == "x64") {
if (ios_use_simulator) {
sdk = "appletvsimulator"
}
} else {
sdk = "iphoneos"
if (target_cpu == "x86" || target_cpu == "x64") {
if (ios_use_simulator) {
sdk = "iphonesimulator"
}
}