Allow specifying toolsets for SwiftPM projects

Equivalent to SwiftPM’s `--toolset` option, implemented in https://github.com/swiftlang/swift-package-manager/pull/8051.

Fixes #2047
rdar://146557424
This commit is contained in:
Alex Hoppen
2025-03-11 13:21:54 -07:00
parent 956742d34f
commit cde206c017
4 changed files with 16 additions and 0 deletions

View File

@@ -208,6 +208,7 @@ package actor SwiftPMBuildSystem: BuiltInBuildSystem {
let destinationSDK = try SwiftSDK.deriveTargetSwiftSDK(
hostSwiftSDK: hostSDK,
hostTriple: hostSwiftPMToolchain.targetTriple,
customToolsets: options.swiftPMOrDefault.toolsets?.map { try AbsolutePath(validating: $0) } ?? [],
customCompileTriple: options.swiftPMOrDefault.triple.map { try Triple($0) },
swiftSDKSelector: options.swiftPMOrDefault.swiftSDK,
store: SwiftSDKBundleStore(