Frontend: allow directory layout for Swift on non-Darwin platforms

Adjust the serialized module loader to allow directory layouts for the
Swift module on non-Darwin targets, unifying the layout across all the
platforms.  It also eases cross-architecture and cross-platform
development by having the same layout, which can enable more similar
flag usage.
This commit is contained in:
Saleem Abdulrasool
2020-06-22 09:53:05 -07:00
parent 1298f71554
commit bdb3da805c
2 changed files with 14 additions and 10 deletions

View File

@@ -137,10 +137,14 @@ static void updateRuntimeLibraryPaths(SearchPathOptions &SearchPathOpts,
if (SearchPathOpts.SkipRuntimeLibraryImportPaths)
return;
if (!Triple.isOSDarwin())
llvm::sys::path::append(LibPath, swift::getMajorArchitectureName(Triple));
SearchPathOpts.RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));
// This is compatibility for <=5.3
if (!Triple.isOSDarwin()) {
llvm::sys::path::append(LibPath, swift::getMajorArchitectureName(Triple));
SearchPathOpts.RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));
}
if (!SearchPathOpts.SDKPath.empty()) {
if (tripleIsMacCatalystEnvironment(Triple)) {
LibPath = SearchPathOpts.SDKPath;