Skip to content

Commit 8f96a6b

Browse files
committed
Frontend: add an additional search path for swift modules
This setups the frontend to search both an architecture suffixed and unsuffixed path. This improves the multi-architecture setup for Windows, enabling it use the directory form of the swift modules with the architectures overlaying in the swift module and leaving the arch suffixed directory for the import libraries. This can be fully generalized as this also enables Linux to use the multi-architecture search path for the swift modules enabling it to eventually adopt a SDK model as well.
1 parent d321725 commit 8f96a6b

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)