Skip to content

Commit 138a44f

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 b520573 commit 138a44f

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
@@ -242,10 +242,14 @@ public struct BuildParameters: Encodable {
242242
switch buildSystemKind {
243243
case .xcode, .swiftbuild:
244244
var configDir: String = configuration.dirname.capitalized
245-
if self.triple.isWindows() {
246-
configDir += "-windows"
247-
} else if self.triple.isLinux() {
248-
configDir += "-linux"
245+
if self.triple.isMacOSX {
246+
// no suffix
247+
} else if self.triple.isAndroid() {
248+
configDir += "-android"
249+
} else if self.triple.isWasm {
250+
configDir += "-webassembly"
251+
} else {
252+
configDir += "-" + (self.triple.darwinPlatform?.platformName ?? self.triple.osNameUnversioned)
249253
}
250254
return dataPath.appending(components: "Products", configDir)
251255
case .native:

0 commit comments

Comments
 (0)