mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix direct clang cc1 emit-pcm commands with vfs overlay on Windows (#85325)
Explicit module builds currently fail on Windows because direct-clang-cc1-module-build emit-pcm commands take overlaid system module map files as inputs but miss the clang VFS overlay. This change adds the overlay and fixes explicit module builds on Windows.
This commit is contained in:
@@ -1992,6 +1992,14 @@ ModuleDependencyInfo ModuleDependencyScanner::bridgeClangModuleDependency(
|
||||
}
|
||||
}
|
||||
|
||||
// Pass the -sdk flag to make the system header VFS overlay finable
|
||||
// for the -direct-clang-cc1-module-build emit-pcm command on Windows.
|
||||
StringRef SDKPath = ScanASTContext.SearchPathOpts.getSDKPath();
|
||||
if (!SDKPath.empty()) {
|
||||
swiftArgs.push_back("-sdk");
|
||||
swiftArgs.push_back(SDKPath.str());
|
||||
}
|
||||
|
||||
// Add args reported by the scanner.
|
||||
auto clangArgs = invocation.getCC1CommandLine();
|
||||
llvm::for_each(clangArgs, addClangArg);
|
||||
|
||||
Reference in New Issue
Block a user