Skip to content

Commit

Permalink
Specify simulator in target triple
Browse files Browse the repository at this point in the history
I notice that simulator builds don't have the `-simulator` [environment](http://llvm.org/doxygen/classllvm_1_1Triple.html#a1778f5c464f88710033f7e11e84a9324) in the target triple. With this change, `-simulator` is added for platforms where `is_device` is false. This matches Xcode.

Closes #154.

RELNOTES: `-simulator` is now added to the target triple passed to `swiftc` (e.g., "-target x86_64-apple-ios10.3-simulator") by the Xcode toolchain when targeting simulator platforms.
PiperOrigin-RevId: 237447785
  • Loading branch information
kastiglione authored and allevato committed Mar 8, 2019
1 parent 6c00792 commit 3de5209
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion swift/internal/xcode_swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,13 @@ def _swift_apple_target_triple(cpu, platform, version):
if platform_string == "macos":
platform_string = "macosx"

return "{cpu}-apple-{platform}{version}".format(
environment = ""
if not platform.is_device:
environment = "-simulator"

return "{cpu}-apple-{platform}{version}{environment}".format(
cpu = cpu,
environment = environment,
platform = platform_string,
version = version,
)
Expand Down

0 comments on commit 3de5209

Please sign in to comment.