@@ -16,6 +16,7 @@ import PackageModel
16
16
import Basic
17
17
import SPMUtility
18
18
import SKTestSupport
19
+ import Build
19
20
import XCTest
20
21
21
22
final class SwiftPMWorkspaceTests : XCTestCase {
@@ -111,11 +112,11 @@ final class SwiftPMWorkspaceTests: XCTestCase {
111
112
112
113
check ( " -target " , arguments: arguments) // Only one!
113
114
#if os(macOS)
114
- check ( " -target " , " x86_64-apple-macosx10 .10" , arguments: arguments)
115
+ check ( " -target " , Triple . hostTriple . tripleString ( forPlatformVersion : " 10 .10" ) , arguments: arguments)
115
116
check ( " -sdk " , arguments: arguments)
116
117
check ( " -F " , arguments: arguments)
117
118
#else
118
- check ( " -target " , " x86_64-unknown-linux " , arguments: arguments)
119
+ check ( " -target " , Triple . hostTriple . tripleString , arguments: arguments)
119
120
#endif
120
121
121
122
check ( " -I " , build. pathString, arguments: arguments)
@@ -334,11 +335,11 @@ final class SwiftPMWorkspaceTests: XCTestCase {
334
335
checkNot ( " -arch " , arguments: arguments)
335
336
check ( " -target " , arguments: arguments) // Only one!
336
337
#if os(macOS)
337
- check ( " -target " , " x86_64-apple-macosx10 .10" , arguments: arguments)
338
+ check ( " -target " , Triple . hostTriple . tripleString ( forPlatformVersion : " 10 .10" ) , arguments: arguments)
338
339
check ( " -isysroot " , arguments: arguments)
339
340
check ( " -F " , arguments: arguments)
340
341
#else
341
- check ( " -target " , " x86_64-unknown-linux " , arguments: arguments)
342
+ check ( " -target " , Triple . hostTriple . tripleString , arguments: arguments)
342
343
#endif
343
344
344
345
check ( " -I " , packageRoot. appending ( components: " Sources " , " lib " , " include " ) . pathString,
@@ -387,9 +388,9 @@ final class SwiftPMWorkspaceTests: XCTestCase {
387
388
let arguments = ws. settings ( for: aswift. asURL, . swift) !. compilerArguments
388
389
check ( " -target " , arguments: arguments) // Only one!
389
390
#if os(macOS)
390
- check ( " -target " , " x86_64-apple-macosx10 .13" , arguments: arguments)
391
+ check ( " -target " , Triple . hostTriple . tripleString ( forPlatformVersion : " 10 .13" ) , arguments: arguments)
391
392
#else
392
- check ( " -target " , " x86_64-unknown-linux " , arguments: arguments)
393
+ check ( " -target " , Triple . hostTriple . tripleString , arguments: arguments)
393
394
#endif
394
395
}
395
396
}
@@ -430,18 +431,6 @@ private func buildPath(
430
431
root: AbsolutePath ,
431
432
config: BuildSetup = TestSourceKitServer . buildSetup) -> AbsolutePath
432
433
{
433
- let buildConfig = " \( config. configuration) "
434
- if let absoluteBuildPath = config. path {
435
- #if os(macOS)
436
- return absoluteBuildPath. appending ( components: " x86_64-apple-macosx " , buildConfig)
437
- #else
438
- return absoluteBuildPath. appending ( components: " x86_64-unknown-linux " , buildConfig)
439
- #endif
440
- } else {
441
- #if os(macOS)
442
- return root. appending ( components: " .build " , " x86_64-apple-macosx " , buildConfig)
443
- #else
444
- return root. appending ( components: " .build " , " x86_64-unknown-linux " , buildConfig)
445
- #endif
446
- }
434
+ let buildPath = config. path ?? root. appending ( component: " .build " )
435
+ return buildPath. appending ( components: Triple . hostTriple. tripleString, " \( config. configuration) " )
447
436
}
0 commit comments