Skip to content

Commit 4f071ba

Browse files
committed
build: Further fixes for Cxx w/o stdlib. (swiftlang#65217)
In swiftlang#65172 I tried to fix a problem when the Cxx module is enabled, but we are not building the stdlib. The fix work for `swiftCxx`, but failed to to realize that `swiftCxxStdlib` overlay is also built, which needs parts of the stdlib. The original swiftlang#65055 only built the Cxx module when `EXTRA_TOOLCHAIN_CONTENT` was set, but swiftlang#65122 changed so it was two independent checks. A more faithful fix will had been to nest the `if` as I am trying to do with this PR. Parts of swiftlang#65172 are still necessary to build in every case, though: the `swiftCxx` target is dependent on the Clang headers and the legacy layouts. Those two pieces are normally in place because of other targets in upstream builds, but fail to materialize when the stdlib is trying to be built with the host compiler. This one and swiftlang#65172 will need to be cherry-picked to 5.9 because swiftlang#65055 and swiftlang#65122 where cherry-picked, so 5.9 is having the same problems as `main`. (cherry picked from commit ccf57da)
1 parent 2ce10f6 commit 4f071ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,10 +1274,10 @@ else()
12741274

12751275
if(SWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT)
12761276
add_subdirectory(stdlib/toolchain)
1277-
endif()
12781277

1279-
if(SWIFT_BUILD_STDLIB_CXX_MODULE)
1280-
add_subdirectory(stdlib/public/Cxx)
1278+
if(SWIFT_BUILD_STDLIB_CXX_MODULE)
1279+
add_subdirectory(stdlib/public/Cxx)
1280+
endif()
12811281
endif()
12821282

12831283
if (BUILD_SWIFT_CONCURRENCY_BACK_DEPLOYMENT_LIBRARIES)

0 commit comments

Comments
 (0)