Skip to content

Commit 2cd79dc

Browse files
committed
Use the correct build path suffix across all platforms
Now it's correct everywhere, not only for macOS, Windows, and Linux. Main motivation was for FreeBSD, and will also work for Android, Wasm, iOS, etc.
1 parent f8451c1 commit 2cd79dc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Sources/SPMBuildCore/BuildParameters/BuildParameters.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,14 @@ public struct BuildParameters: Encodable {
247247
switch buildSystemKind {
248248
case .xcode, .swiftbuild:
249249
var configDir: String = configuration.dirname.capitalized
250-
if self.triple.isWindows() {
251-
configDir += "-windows"
252-
} else if self.triple.isLinux() {
253-
configDir += "-linux"
250+
if self.triple.isMacOSX {
251+
// no suffix
252+
} else if self.triple.isAndroid() {
253+
configDir += "-android"
254+
} else if self.triple.isWasm {
255+
configDir += "-webassembly"
256+
} else {
257+
configDir += "-" + (self.triple.darwinPlatform?.platformName ?? self.triple.osNameUnversioned)
254258
}
255259
return dataPath.appending(components: "Products", configDir)
256260
case .native:

0 commit comments

Comments
 (0)