Skip to content

Commit 7c5d422

Browse files
MaxDesiatovaciidgh
authored andcommitted
Pass hostTriple to BuildParameters in tests
1 parent a9a5fc1 commit 7c5d422

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/SPMBuildCore/BuildParameters.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ public struct BuildParameters: Encodable {
126126
dataPath: AbsolutePath,
127127
configuration: BuildConfiguration,
128128
toolchain: Toolchain,
129+
hostTriple: Triple? = nil,
129130
destinationTriple: Triple? = nil,
130131
flags: BuildFlags,
131132
xcbuildFlags: [String] = [],
@@ -147,7 +148,7 @@ public struct BuildParameters: Encodable {
147148
self.dataPath = dataPath
148149
self.configuration = configuration
149150
self._toolchain = _Toolchain(toolchain: toolchain)
150-
self.hostTriple = .getHostTriple(usingSwiftCompiler: toolchain.swiftCompiler)
151+
self.hostTriple = hostTriple ?? .getHostTriple(usingSwiftCompiler: toolchain.swiftCompiler)
151152
self.triple = destinationTriple ?? .getHostTriple(usingSwiftCompiler: toolchain.swiftCompiler)
152153
self.flags = flags
153154
self.xcbuildFlags = xcbuildFlags

Tests/BuildTests/BuildPlanTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ final class BuildPlanTests: XCTestCase {
6666
dataPath: buildPath,
6767
configuration: config,
6868
toolchain: MockToolchain(),
69+
hostTriple: hostTriple,
6970
destinationTriple: destinationTriple,
7071
flags: flags,
7172
jobs: 3,

0 commit comments

Comments
 (0)