Add iOS simulator support in GN.

This builds fine on my laptop, but fails to link on the bots,
so I'm leaving out a new Build bot for now.

BUG=skia:6329

Change-Id: I4b33770f13ab9dec914d090b45d9921b19ee2c9d
Reviewed-on: https://skia-review.googlesource.com/9519
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This commit is contained in:
Mike Klein 2017-03-13 09:25:33 -07:00 committed by Skia Commit-Bot
parent c2e9f6d7fb
commit 7a5e0f3847
2 changed files with 13 additions and 2 deletions

View File

@ -50,7 +50,11 @@ if (!is_clang && !is_win) {
}
if (is_ios) {
ios_sysroot = exec_script("find_ios_sysroot.py", [], "trim string")
sdk = "iphoneos"
if (target_cpu == "x86" || target_cpu == "x64") {
sdk = "iphonesimulator"
}
ios_sysroot = exec_script("find_ios_sysroot.py", [ sdk ], "trim string")
}
config("default") {
@ -190,6 +194,10 @@ config("default") {
_target = target_cpu
if (target_cpu == "arm") {
_target = "armv7"
} else if (target_cpu == "x86") {
_target = "i386"
} else if (target_cpu == "x64") {
_target = "x86_64"
}
asmflags += [
"-isysroot",

View File

@ -6,5 +6,8 @@
# found in the LICENSE file.
import subprocess
import sys
print subprocess.check_output('xcrun --sdk iphoneos --show-sdk-path'.split())
(sdk,) = sys.argv[1:]
print subprocess.check_output(['xcrun', '--sdk', sdk, '--show-sdk-path'])