mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Hard-code the 'Darwin' module as having been built without C++ interop
Textual interfaces for 'Darwin' built with recent compilers specify that it is built witout C++ interop enabled. However, to ensure compatibility with versions of the 'Darwin' module built with older compilers, we hard-code this fact. This is required to break the module cycle that occurs when building the 'Darwin' module with C++ interop enabled, where the underlying 'Darwin' clang module depends on C++ standard library for which the compiler brings in the 'CxxStdlib' Swift overlay, which depends on 'Darwin'.
This commit is contained in:
@@ -1478,7 +1478,13 @@ void ModuleDependencyScanner::resolveSwiftOverlayDependenciesForModule(
|
||||
|
||||
// If the textual interface was built without C++ interop, do not query
|
||||
// the C++ Standard Library Swift overlay for its compilation.
|
||||
if (llvm::find(commandLine, "-formal-cxx-interoperability-mode=off") ==
|
||||
//
|
||||
// FIXME: We always declare the 'Darwin' module as formally having been built
|
||||
// without C++Interop, for compatibility with prior versions. Once we are certain
|
||||
// that we are only building against modules built with support of
|
||||
// '-formal-cxx-interoperability-mode', this hard-coded check should be removed.
|
||||
if (moduleID.ModuleName != "Darwin" &&
|
||||
llvm::find(commandLine, "-formal-cxx-interoperability-mode=off") ==
|
||||
commandLine.end()) {
|
||||
for (const auto &clangDepName : allClangDependencies) {
|
||||
// If this Clang module is a part of the C++ stdlib, and we haven't
|
||||
|
||||
Reference in New Issue
Block a user