diff options
-rw-r--r-- | gn/BUILD.gn | 10 | ||||
-rw-r--r-- | gn/find_ios_sysroot.py | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn index 5ccc729c3e..7741354097 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -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", diff --git a/gn/find_ios_sysroot.py b/gn/find_ios_sysroot.py index 2d9f8d61d1..789ae9f9a5 100644 --- a/gn/find_ios_sysroot.py +++ b/gn/find_ios_sysroot.py @@ -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']) |