Skip to content

Commit

Permalink
[Dependency Scanning] Enable scanner-side up-to-date binary module va…
Browse files Browse the repository at this point in the history
…lidation on supporting compilers

After ffbae26 landed, it is now safe to enable this behavior.
  • Loading branch information
artemcm committed Aug 1, 2024
1 parent a32005e commit 598e3e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ public extension Driver {
try commandLine.appendLast(.clangScannerModuleCachePath, from: &parsedOptions)
}

if isFrontendArgSupported(.scannerModuleValidation) {
commandLine.appendFlag(.scannerModuleValidation)
}

if isFrontendArgSupported(.scannerPrefixMap) {
// construct `-scanner-prefix-mapper` for scanner.
for (key, value) in prefixMapping {
Expand Down
4 changes: 4 additions & 0 deletions Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@ final class ExplicitModuleBuildTests: XCTestCase {
scannerCommand.removeFirst()
}

if driver.isFrontendArgSupported(.scannerModuleValidation) {
XCTAssertTrue(scannerCommand.contains("-scanner-module-validation"))
}

// Ensure we do not propagate the usual PCH-handling arguments to the scanner invocation
XCTAssertFalse(scannerCommand.contains("-pch-output-dir"))
XCTAssertFalse(scannerCommand.contains("Foo.o"))
Expand Down

0 comments on commit 598e3e2

Please sign in to comment.