Skip to content

Commit 20cbf5e

Browse files
committed
[Dependency Scanning] Do not include PCH-handling command-line flags on the scanning jobs
These jobs do not require handling of the module's PCH.
1 parent 39f483f commit 20cbf5e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public extension Driver {
4949
commandLine.appendFlag("-frontend")
5050
commandLine.appendFlag("-scan-dependencies")
5151
try addCommonFrontendOptions(commandLine: &commandLine, inputs: &inputs,
52-
bridgingHeaderHandling: .precompiled,
52+
bridgingHeaderHandling: .ignored,
5353
moduleDependencyGraphUse: .dependencyScan)
5454
// FIXME: MSVC runtime flags
5555

@@ -224,7 +224,7 @@ public extension Driver {
224224
commandLine.appendFlag("-scan-dependencies")
225225
commandLine.appendFlag("-import-prescan")
226226
try addCommonFrontendOptions(commandLine: &commandLine, inputs: &inputs,
227-
bridgingHeaderHandling: .precompiled,
227+
bridgingHeaderHandling: .ignored,
228228
moduleDependencyGraphUse: .dependencyScan)
229229
// FIXME: MSVC runtime flags
230230

@@ -255,7 +255,7 @@ public extension Driver {
255255
commandLine.appendFlag("-frontend")
256256
commandLine.appendFlag("-scan-dependencies")
257257
try addCommonFrontendOptions(commandLine: &commandLine, inputs: &inputs,
258-
bridgingHeaderHandling: .precompiled,
258+
bridgingHeaderHandling: .ignored,
259259
moduleDependencyGraphUse: .dependencyScan)
260260

261261
let batchScanInputFilePath = try serializeBatchScanningModuleArtifacts(moduleInfos: moduleInfos)

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
758758
var driver = try Driver(args: ["swiftc",
759759
"-I", cHeadersPath,
760760
"-I", swiftModuleInterfacesPath,
761+
"-import-objc-header",
761762
"-experimental-explicit-module-build",
762763
"-working-directory", path.pathString,
763764
"-disable-clang-target",
@@ -772,6 +773,9 @@ final class ExplicitModuleBuildTests: XCTestCase {
772773
scannerCommand.removeFirst()
773774
}
774775

776+
// Ensure we do not propagate the ususal PCH-handling arguments to the scanner invocation
777+
XCTAssertFalse(scannerCommand.contains("-pch-output-dir"))
778+
775779
// Here purely to dump diagnostic output in a reasonable fashion when things go wrong.
776780
let lock = NSLock()
777781

0 commit comments

Comments
 (0)