Skip to content

Commit 63cac0b

Browse files
authored
Merge pull request #1717 from ahoppen/windows-response-file-clang-only
Only pass `--rsp-quoting=windows` to `clang`
2 parents 4fb9683 + 73d004d commit 63cac0b

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Sources/SwiftDriver/Jobs/LinkJob.swift

-9
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,6 @@ extension Driver {
4949
mutating func linkJob(inputs: [TypedVirtualPath]) throws -> Job {
5050
var commandLine: [Job.ArgTemplate] = []
5151

52-
#if os(Windows)
53-
// We invoke clang as `clang.exe`, which expects a POSIX-style response file by default (`clang-cl.exe` expects
54-
// Windows-style response files).
55-
// The driver is outputting Windows-style response files because swift-frontend expects Windows-style response
56-
// files.
57-
// Force `clang.exe` into parsing Windows-style response files.
58-
commandLine.appendFlag("--rsp-quoting=windows")
59-
#endif
60-
6152
// Compute the final output file
6253
let outputFile: VirtualPath
6354
if let output = parsedOptions.getLastArgument(.o) {

Sources/SwiftDriver/Jobs/WindowsToolchain+LinkerSupport.swift

+7
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ extension WindowsToolchain {
9494
let clangTool: Tool = cxxCompatEnabled ? .clangxx : .clang
9595
var clang = try getToolPath(clangTool)
9696

97+
// We invoke clang as `clang.exe`, which expects a POSIX-style response file by default (`clang-cl.exe` expects
98+
// Windows-style response files).
99+
// The driver is outputting Windows-style response files because swift-frontend expects Windows-style response
100+
// files.
101+
// Force `clang.exe` into parsing Windows-style response files.
102+
commandLine.appendFlag("--rsp-quoting=windows")
103+
97104
let targetTriple = targetInfo.target.triple
98105
if !targetTriple.triple.isEmpty {
99106
commandLine.appendFlag("-target")

0 commit comments

Comments
 (0)