|
@@ -581,9 +581,18 @@ static void inferFrameworkLink(Module *Mod, const DirectoryEntry *FrameworkDir,
|
|
SmallString<128> LibName;
|
|
SmallString<128> LibName;
|
|
LibName += FrameworkDir->getName();
|
|
LibName += FrameworkDir->getName();
|
|
llvm::sys::path::append(LibName, Mod->Name);
|
|
llvm::sys::path::append(LibName, Mod->Name);
|
|
- if (FileMgr.getFile(LibName)) {
|
|
|
|
- Mod->LinkLibraries.push_back(Module::LinkLibrary(Mod->Name,
|
|
|
|
- /*IsFramework=*/true));
|
|
|
|
|
|
+
|
|
|
|
+ // The library name of a framework has more than one possible extension since
|
|
|
|
+ // the introduction of the text-based dynamic library format. We need to check
|
|
|
|
+ // for both before we give up.
|
|
|
|
+ static const char *frameworkExtensions[] = {"", ".tbd"};
|
|
|
|
+ for (const auto *extension : frameworkExtensions) {
|
|
|
|
+ llvm::sys::path::replace_extension(LibName, extension);
|
|
|
|
+ if (FileMgr.getFile(LibName)) {
|
|
|
|
+ Mod->LinkLibraries.push_back(Module::LinkLibrary(Mod->Name,
|
|
|
|
+ /*IsFramework=*/true));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|