mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Interpreter] Fall back to loading Swift dylibs from /usr/lib/swift on Apple platforms.
Continue to load the dylibs next to the compiler if they exist. If they don't, then use the OS's dylibs. rdar://problem/47528005
This commit is contained in:
@@ -30,6 +30,11 @@
|
||||
using namespace swift;
|
||||
using namespace llvm::opt;
|
||||
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
/// The path for Swift libraries in the OS.
|
||||
#define OS_LIBRARY_PATH "/usr/lib/swift"
|
||||
#endif
|
||||
|
||||
swift::CompilerInvocation::CompilerInvocation() {
|
||||
setTargetTriple(llvm::sys::getDefaultTargetTriple());
|
||||
}
|
||||
@@ -66,7 +71,11 @@ static void updateRuntimeLibraryPaths(SearchPathOptions &SearchPathOpts,
|
||||
llvm::SmallString<128> LibPath(SearchPathOpts.RuntimeResourcePath);
|
||||
|
||||
llvm::sys::path::append(LibPath, getPlatformNameForTriple(Triple));
|
||||
SearchPathOpts.RuntimeLibraryPath = LibPath.str();
|
||||
SearchPathOpts.RuntimeLibraryPaths.clear();
|
||||
SearchPathOpts.RuntimeLibraryPaths.push_back(LibPath.str());
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
SearchPathOpts.RuntimeLibraryPaths.push_back(OS_LIBRARY_PATH);
|
||||
#endif
|
||||
|
||||
// Set up the import paths containing the swiftmodules for the libraries in
|
||||
// RuntimeLibraryPath.
|
||||
|
||||
Reference in New Issue
Block a user