Skip to content

Commit f6045fc

Browse files
author
Richard Howell
committed
remove toolchain from FileBuildSettings
1 parent c868ec6 commit f6045fc

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

Sources/SKCore/CompilationDatabaseBuildSystem.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ extension CompilationDatabaseBuildSystem: BuildSystem {
4343
guard let db = database(for: url),
4444
let cmd = db[url].first else { return nil }
4545
return FileBuildSettings(
46-
preferredToolchain: nil, // FIXME: infer from path
4746
compilerArguments: Array(cmd.commandLine.dropFirst()),
4847
workingDirectory: cmd.directory
4948
)

Sources/SKCore/FallbackBuildSystem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public final class FallbackBuildSystem: BuildSystem {
5959
]
6060
}
6161
args.append(path.pathString)
62-
return FileBuildSettings(preferredToolchain: nil, compilerArguments: args)
62+
return FileBuildSettings(compilerArguments: args)
6363
}
6464

6565
func settingsClang(_ path: AbsolutePath, _ language: Language) -> FileBuildSettings {
@@ -71,6 +71,6 @@ public final class FallbackBuildSystem: BuildSystem {
7171
]
7272
}
7373
args.append(path.pathString)
74-
return FileBuildSettings(preferredToolchain: nil, compilerArguments: args)
74+
return FileBuildSettings(compilerArguments: args)
7575
}
7676
}

Sources/SKCore/FileBuildSettings.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,20 @@
1212

1313
/// Build settings for a single file.
1414
///
15-
/// Encapsulates all the settings needed to compile a single file, including the compiler arguments,
16-
/// working directory, and preferred toolchain if any. FileBuildSettings are typically the result
17-
/// of a BuildSystem query.
15+
/// Encapsulates all the settings needed to compile a single file, including the compiler arguments
16+
/// and working directory. FileBuildSettings are typically the result of a BuildSystem query.
1817
public struct FileBuildSettings {
1918

20-
/// The Toolchain that is preferred for compiling this file, if any.
21-
public var preferredToolchain: Toolchain? = nil
22-
2319
/// The compiler arguments to use for this file.
2420
public var compilerArguments: [String]
2521

2622
/// The working directory to resolve any relative paths in `compilerArguments`.
2723
public var workingDirectory: String? = nil
2824

2925
public init(
30-
preferredToolchain: Toolchain? = nil,
3126
compilerArguments: [String],
3227
workingDirectory: String? = nil)
3328
{
34-
self.preferredToolchain = preferredToolchain
3529
self.compilerArguments = compilerArguments
3630
self.workingDirectory = workingDirectory
3731
}

Sources/SKSwiftPMWorkspace/SwiftPMWorkspace.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,7 @@ extension SwiftPMWorkspace {
257257
func impl(_ path: AbsolutePath) -> FileBuildSettings? {
258258
for package in packageGraph.packages where path == package.manifest.path {
259259
let compilerArgs = workspace.interpreterFlags(for: package.path) + [path.pathString]
260-
return FileBuildSettings(
261-
preferredToolchain: nil,
262-
compilerArguments: compilerArgs
263-
)
260+
return FileBuildSettings(compilerArguments: compilerArgs)
264261
}
265262
return nil
266263
}
@@ -319,7 +316,6 @@ extension SwiftPMWorkspace {
319316
args += td.compileArguments()
320317

321318
return FileBuildSettings(
322-
preferredToolchain: nil,
323319
compilerArguments: args,
324320
workingDirectory: workspacePath.pathString)
325321
}
@@ -382,7 +378,6 @@ extension SwiftPMWorkspace {
382378
}
383379

384380
return FileBuildSettings(
385-
preferredToolchain: nil,
386381
compilerArguments: args,
387382
workingDirectory: workspacePath.pathString)
388383
}

0 commit comments

Comments
 (0)