Skip to content

Commit c3529ef

Browse files
authored
Merge pull request #42419 from compnerd/unarch-search
Frontend: add an additional search path for swift modules
2 parents 58c8e2e + 8f96a6b commit c3529ef

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,15 @@ static void updateRuntimeLibraryPaths(SearchPathOptions &SearchPathOpts,
188188
LibPath = SearchPathOpts.getSDKPath();
189189
llvm::sys::path::append(LibPath, "usr", "lib", "swift");
190190
if (!Triple.isOSDarwin()) {
191+
// Use the non-architecture suffixed form with directory-layout
192+
// swiftmodules.
191193
llvm::sys::path::append(LibPath, getPlatformNameForTriple(Triple));
194+
RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));
195+
196+
// Compatibility with older releases - use the architecture suffixed form
197+
// for pre-directory-layout multi-architecture layout. Note that some
198+
// platforms (e.g. Windows) will use this even with directory layout in
199+
// older releases.
192200
llvm::sys::path::append(LibPath, swift::getMajorArchitectureName(Triple));
193201
}
194202
RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));

0 commit comments

Comments
 (0)