mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #42486 from xymus/ignore-adjacent-public-swiftmodule
[ModuleInterface] Ignore adjacent swiftmodules under the Frameworks folder
This commit is contained in:
@@ -651,10 +651,20 @@ class ModuleInterfaceLoaderImpl {
|
||||
|
||||
std::pair<std::string, std::string> getCompiledModuleCandidates() {
|
||||
std::pair<std::string, std::string> result;
|
||||
// Keep track of whether we should attempt to load a .swiftmodule adjacent
|
||||
// to the .swiftinterface.
|
||||
// Should we attempt to load a swiftmodule adjacent to the swiftinterface?
|
||||
bool shouldLoadAdjacentModule = true;
|
||||
|
||||
// Don't use the adjacent swiftmodule for frameworks from the public
|
||||
// Frameworks folder of the SDK.
|
||||
SmallString<128> publicFrameworksPath;
|
||||
llvm::sys::path::append(publicFrameworksPath,
|
||||
ctx.SearchPathOpts.getSDKPath(),
|
||||
"System", "Library", "Frameworks");
|
||||
if (!ctx.SearchPathOpts.getSDKPath().empty() &&
|
||||
modulePath.startswith(publicFrameworksPath)) {
|
||||
shouldLoadAdjacentModule = false;
|
||||
}
|
||||
|
||||
switch (loadMode) {
|
||||
case ModuleLoadingMode::OnlyInterface:
|
||||
// Always skip both the caches and adjacent modules, and always build the
|
||||
|
||||
Reference in New Issue
Block a user