mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Dependency Scanning] Add support for placing explicitly-built SDK modules into a separate module cache
With '-sdk-module-cache-path', Swift textual interfaces found in the SDK will be built into a separate SDK-specific module cache. Clang modules are not yet affected by this change, pending addition of the required API.
This commit is contained in:
@@ -2890,6 +2890,18 @@ void setOutputPath(ResultTy &resolvedOutputPath, const StringRef &moduleName,
|
||||
const CompilerInvocation &CI, const ArgListTy &extraArgs) {
|
||||
auto &outputPath = resolvedOutputPath.outputPath;
|
||||
outputPath = CI.getClangModuleCachePath();
|
||||
|
||||
// Dependency-scanner-specific module output path handling
|
||||
if ((CI.getFrontendOptions().RequestedAction ==
|
||||
FrontendOptions::ActionType::ScanDependencies)) {
|
||||
if (!sdkPath.empty() &&
|
||||
hasPrefix(llvm::sys::path::begin(interfacePath.str()), llvm::sys::path::end(interfacePath.str()),
|
||||
llvm::sys::path::begin(sdkPath), llvm::sys::path::end(sdkPath)))
|
||||
outputPath = CI.getFrontendOptions().ExplicitSDKModulesOutputPath;
|
||||
else
|
||||
outputPath = CI.getFrontendOptions().ExplicitModulesOutputPath;
|
||||
}
|
||||
|
||||
llvm::sys::path::append(outputPath, moduleName);
|
||||
outputPath.append("-");
|
||||
auto hashStart = outputPath.size();
|
||||
|
||||
Reference in New Issue
Block a user