Skip to content

Commit 0e8b2f8

Browse files
committed
[Integrated Swift driver] Pass along the Swift location.
Rather than letting the integrated Swift driver guess at where the Swift frontend is located, pass through the location of the Swift compiler. This also allows SWIFT_EXEC overrides to work with the integrated driver.
1 parent d4d56d8 commit 0e8b2f8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Sources/Build/ManifestBuilder.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,29 +200,28 @@ extension LLBuildManifestBuilder {
200200
do {
201201
// Use the integrated Swift driver to compute the set of frontend
202202
// jobs needed to build this Swift target.
203-
var driver = try Driver(args: target.emitCommandLine(), fileSystem: target.fs)
203+
var commandLine = target.emitCommandLine();
204+
commandLine.append("-driver-use-frontend-path")
205+
commandLine.append(buildParameters.toolchain.swiftCompiler.pathString)
206+
var driver = try Driver(args: commandLine, fileSystem: target.fs)
204207
let jobs = try driver.planBuild()
205208
let resolver = try ArgsResolver(fileSystem: target.fs)
206209

207210
for job in jobs {
208-
// Figure out which tool we are using.
209-
// FIXME: This feels like a hack.
210-
let datool: String
211+
let tool = try resolver.resolve(.path(job.tool))
211212
let isSwiftFrontend: Bool
212213
switch job.kind {
213214
case .compile, .mergeModule, .emitModule, .generatePCH,
214215
.generatePCM, .interpret, .repl, .printTargetInfo,
215216
.versionRequest, .backend:
216-
datool = buildParameters.toolchain.swiftCompiler.pathString
217217
isSwiftFrontend = true
218218

219219
case .autolinkExtract, .generateDSYM, .help, .link, .verifyDebugInfo:
220-
datool = try resolver.resolve(.path(job.tool))
221220
isSwiftFrontend = false
222221
}
223222

224223
let commandLine = try job.commandLine.map{ try resolver.resolve($0) }
225-
let arguments = [datool] + commandLine
224+
let arguments = [tool] + commandLine
226225

227226
let jobInputs = job.inputs.map { $0.resolveToNode() }
228227
let jobOutputs = job.outputs.map { $0.resolveToNode() }

0 commit comments

Comments
 (0)