Skip to content

Commit f1761dc

Browse files
authored
Merge pull request #841 from artemcm/NoPCHHandleInScan
[Dependency Scanning] Do not include PCH-handling command-line flags on the scanning jobs
2 parents 6c20199 + 20cbf5e commit f1761dc

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
@@ -48,7 +48,7 @@ public extension Driver {
4848
commandLine.appendFlag("-frontend")
4949
commandLine.appendFlag("-scan-dependencies")
5050
try addCommonFrontendOptions(commandLine: &commandLine, inputs: &inputs,
51-
bridgingHeaderHandling: .precompiled,
51+
bridgingHeaderHandling: .ignored,
5252
moduleDependencyGraphUse: .dependencyScan)
5353
// FIXME: MSVC runtime flags
5454

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

@@ -254,7 +254,7 @@ public extension Driver {
254254
commandLine.appendFlag("-frontend")
255255
commandLine.appendFlag("-scan-dependencies")
256256
try addCommonFrontendOptions(commandLine: &commandLine, inputs: &inputs,
257-
bridgingHeaderHandling: .precompiled,
257+
bridgingHeaderHandling: .ignored,
258258
moduleDependencyGraphUse: .dependencyScan)
259259

260260
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)