Skip to content

Commit a9a5fc1

Browse files
MaxDesiatovaciidgh
authored andcommitted
Use host triple in createIndexStoreAPI
1 parent 04e0ec6 commit a9a5fc1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Sources/Build/BuildDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public final class BuildExecutionContext {
262262
private var indexStoreAPICache = LazyCache(createIndexStoreAPI)
263263
private func createIndexStoreAPI() -> Result<IndexStoreAPI, Error> {
264264
Result {
265-
let ext = buildParameters.triple.dynamicLibraryExtension
265+
let ext = buildParameters.hostTriple.dynamicLibraryExtension
266266
let indexStoreLib = buildParameters.toolchain.toolchainLibDir.appending(component: "libIndexStore" + ext)
267267
return try IndexStoreAPI(dylib: indexStoreLib)
268268
}

Sources/SPMBuildCore/BuildParameters.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public struct BuildParameters: Encodable {
4646
public var toolchain: Toolchain { _toolchain.toolchain }
4747
private let _toolchain: _Toolchain
4848

49+
/// Host triple.
50+
public var hostTriple: Triple
51+
4952
/// Destination triple.
5053
public var triple: Triple
5154

@@ -144,6 +147,7 @@ public struct BuildParameters: Encodable {
144147
self.dataPath = dataPath
145148
self.configuration = configuration
146149
self._toolchain = _Toolchain(toolchain: toolchain)
150+
self.hostTriple = .getHostTriple(usingSwiftCompiler: toolchain.swiftCompiler)
147151
self.triple = destinationTriple ?? .getHostTriple(usingSwiftCompiler: toolchain.swiftCompiler)
148152
self.flags = flags
149153
self.xcbuildFlags = xcbuildFlags

0 commit comments

Comments
 (0)