Skip to content

Commit 0bb02fa

Browse files
committed
[Dependency Scanning] Pass the bridging header path to scanning action ivocations
1 parent 3a2ccf4 commit 0bb02fa

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public extension Driver {
107107
commandLine.appendFlag("-frontend")
108108
commandLine.appendFlag("-scan-dependencies")
109109
try addCommonFrontendOptions(commandLine: &commandLine, inputs: &inputs,
110-
bridgingHeaderHandling: .ignored,
110+
bridgingHeaderHandling: .parsed,
111111
moduleDependencyGraphUse: .dependencyScan)
112112
// FIXME: MSVC runtime flags
113113

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
269269
let cHeadersPath: AbsolutePath =
270270
testInputsPath.appending(component: "ExplicitModuleBuilds")
271271
.appending(component: "CHeaders")
272+
let bridgingHeaderpath: AbsolutePath =
273+
cHeadersPath.appending(component: "Bridging.h")
272274
let swiftModuleInterfacesPath: AbsolutePath =
273275
testInputsPath.appending(component: "ExplicitModuleBuilds")
274276
.appending(component: "Swift")
@@ -278,6 +280,7 @@ final class ExplicitModuleBuildTests: XCTestCase {
278280
"-I", cHeadersPath.nativePathString(escaped: true),
279281
"-I", swiftModuleInterfacesPath.nativePathString(escaped: true),
280282
"-explicit-module-build",
283+
"-import-objc-header", bridgingHeaderpath.nativePathString(escaped: true),
281284
main.nativePathString(escaped: true)] + sdkArgumentsForTesting)
282285

283286
let jobs = try driver.planBuild()
@@ -338,6 +341,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
338341
try checkExplicitModuleBuildJob(job: job, moduleId: .clang("G"),
339342
dependencyGraph: dependencyGraph)
340343
}
344+
else if relativeOutputPathFileName.starts(with: "F-") {
345+
try checkExplicitModuleBuildJob(job: job, moduleId: .clang("F"),
346+
dependencyGraph: dependencyGraph)
347+
}
341348
else if relativeOutputPathFileName.starts(with: "SwiftShims-") {
342349
try checkExplicitModuleBuildJob(job: job, moduleId: .clang("SwiftShims"),
343350
dependencyGraph: dependencyGraph)
@@ -357,7 +364,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
357364
case .temporary(_):
358365
let baseName = "testExplicitModuleBuildJobs"
359366
XCTAssertTrue(matchTemporary(outputFilePath, basename: baseName, fileExtension: "o") ||
360-
matchTemporary(outputFilePath, basename: baseName, fileExtension: "autolink"))
367+
matchTemporary(outputFilePath, basename: baseName, fileExtension: "autolink") ||
368+
matchTemporary(outputFilePath, basename: "Bridging-", fileExtension: "pch"))
361369
default:
362370
XCTFail("Unexpected module dependency build job output: \(outputFilePath)")
363371
}

0 commit comments

Comments
 (0)