Skip to content

Commit 0df576f

Browse files
authored
PackageModel: make Toolset.init(toolchainBinDir:buildFlags:) public (#7064)
Previously the only available initializer allowed creating toolsets from serialized form stored on a file system. This initializer allows creating `Toolset` values directly with given build flags and toolchain binaries directory path, which may be needed by libSwiftPM clients.
1 parent bf78417 commit 0df576f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/PackageModel/Toolset.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ extension Toolset {
157157
}
158158
}
159159

160-
init(toolchainBinDir: AbsolutePath, buildFlags: BuildFlags) {
160+
/// Initialize a new ad-hoc toolset that wasn't previously serialized, but created in memory.
161+
/// - Parameters:
162+
/// - toolchainBinDir: absolute path to the toolchain binaries directory, which are used in this toolset.
163+
/// - buildFlags: flags provided to each tool as CLI options.
164+
public init(toolchainBinDir: AbsolutePath, buildFlags: BuildFlags = .init()) {
161165
self.rootPaths = [toolchainBinDir]
162166
self.knownTools = [
163167
.cCompiler: .init(extraCLIOptions: buildFlags.cCompilerFlags),

0 commit comments

Comments
 (0)