Skip to content

Commit 5e7743e

Browse files
committed
Fix pch import logic for compile job
1 parent 5d98611 commit 5e7743e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Sources/SwiftDriver/Jobs/CompileJob.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,17 @@ extension Driver {
105105

106106
if let importedObjCHeader = importedObjCHeader {
107107
commandLine.appendFlag(.importObjcHeader)
108-
if !parsedOptions.contains(.pchOutputDir), let pch = bridgingPrecompiledHeader {
109-
commandLine.appendPath(pch)
108+
if let pch = bridgingPrecompiledHeader {
109+
if parsedOptions.contains(.pchOutputDir) {
110+
commandLine.appendPath(importedObjCHeader)
111+
if compilerMode != .singleCompile {
112+
commandLine.appendFlag(.pchDisableValidation)
113+
}
114+
} else {
115+
commandLine.appendPath(pch)
116+
}
110117
} else {
111118
commandLine.appendPath(importedObjCHeader)
112-
if compilerMode != .singleCompile {
113-
commandLine.appendFlag(.pchDisableValidation)
114-
}
115119
}
116120
}
117121

0 commit comments

Comments
 (0)