Skip to content

Commit 6ab1681

Browse files
authored
Merge pull request #1627 from xedin/rename-build-triple-into-build-destination
[SwiftPM] Switch from `BuildTriple` to `BuildDestination`
2 parents a3bb2d7 + 2bb86c5 commit 6ab1681

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Sources/BuildSystemIntegration/SwiftPMBuildSystem.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,25 @@ private func preferredToolchain(_ toolchainRegistry: ToolchainRegistry) async ->
6969
])
7070
}
7171

72-
fileprivate extension BuildTriple {
72+
fileprivate extension BuildDestination {
7373
/// A string that can be used to identify the build triple in `ConfiguredTarget.runDestinationID`.
74+
///
75+
/// `BuildSystemManager.canonicalConfiguredTarget` picks the canonical target based on alphabetical
76+
/// ordering. We rely on the string "destination" being ordered before "tools" so that we prefer a
77+
/// `destination` (or "target") target over a `tools` (or "host") target.
7478
var id: String {
7579
switch self {
76-
case .tools:
80+
case .host:
7781
return "tools"
78-
case .destination:
82+
case .target:
7983
return "destination"
8084
}
8185
}
8286
}
8387

8488
fileprivate extension ConfiguredTarget {
8589
init(_ buildTarget: any SwiftBuildTarget) {
86-
self.init(targetID: buildTarget.name, runDestinationID: buildTarget.buildTriple.id)
90+
self.init(targetID: buildTarget.name, runDestinationID: buildTarget.destination.id)
8791
}
8892

8993
static let forPackageManifest = ConfiguredTarget(targetID: "", runDestinationID: "")

0 commit comments

Comments
 (0)