mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[cxx-interop] Support CxxStdlib overlay for libc++ on Linux
This teaches Swift to rebuild the CxxStdlib overlay module from its interface when using a C++ standard library that is not the platform default, specifically libc++ on Linux. rdar://138838506
This commit is contained in:
@@ -398,6 +398,15 @@ void CompilerInvocation::computeCXXStdlibOptions() {
|
||||
LangOpts.CXXStdlib = toCXXStdlibKind(cxxStdlibKind);
|
||||
LangOpts.PlatformDefaultCXXStdlib = toCXXStdlibKind(cxxDefaultStdlibKind);
|
||||
}
|
||||
|
||||
if (!LangOpts.isUsingPlatformDefaultCXXStdlib()) {
|
||||
// The CxxStdlib overlay was built for the platform default C++ stdlib, and
|
||||
// its .swiftmodule file refers to implementation-specific symbols (such as
|
||||
// namespace __1 in libc++, or namespace __cxx11 in libstdc++). Let's
|
||||
// proactively rebuild the CxxStdlib module from its .swiftinterface if a
|
||||
// non-default C++ stdlib is used.
|
||||
FrontendOpts.PreferInterfaceForModules.push_back("CxxStdlib");
|
||||
}
|
||||
}
|
||||
|
||||
void CompilerInvocation::setRuntimeResourcePath(StringRef Path) {
|
||||
|
||||
Reference in New Issue
Block a user