Skip to content

Commit

Permalink
Properly fix the Swift simulator target for Buck on arm64 (facebook#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
xianwen committed May 17, 2021
1 parent 67522fb commit a511b1c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/com/facebook/buck/swift/SwiftCompile.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,13 @@ private SwiftCompileStep makeCompileStep(SourcePathResolverAdapter resolver) {
ImmutableList.Builder<String> compilerCommand = ImmutableList.builder();
compilerCommand.addAll(swiftCompiler.getCommandPrefix(resolver));

compilerCommand.add("-target", swiftTarget.getTriple());
String swiftTargetTriple = swiftTarget.getTriple();
// For arm64 simulator target, we need to add a "simulator" postfix to differentiate.
// Otherwise it'll be treated as targeting "ios" and would fail the compilation.
if (this.flavor.getName().contains("simulator") && this.flavor.getName().contains("arm64")) {
swiftTargetTriple += "-simulator";
}
compilerCommand.add("-target", swiftTargetTriple);

if (bridgingHeader.isPresent()) {
compilerCommand.add(
Expand Down

0 comments on commit a511b1c

Please sign in to comment.