Skip to content

Commit 66cc676

Browse files
authored
Merge pull request #65055 from apple/egorzhdan/cmake-cxx-toolchain
[cxx-interop] Include `Cxx` and `CxxStdlib` modules in no-stdlib builds
2 parents ef46563 + 14f3231 commit 66cc676

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,7 @@ else()
12651265

12661266
if(SWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT)
12671267
add_subdirectory(stdlib/toolchain)
1268+
add_subdirectory(stdlib/public/Cxx)
12681269
endif()
12691270

12701271
if (BUILD_SWIFT_CONCURRENCY_BACK_DEPLOYMENT_LIBRARIES)

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,7 @@ function(add_swift_target_library name)
16781678
IS_SDK_OVERLAY
16791679
IS_STDLIB
16801680
IS_STDLIB_CORE
1681+
IS_SWIFT_ONLY
16811682
NOSWIFTRT
16821683
OBJECT_LIBRARY
16831684
SHARED
@@ -1814,7 +1815,7 @@ function(add_swift_target_library name)
18141815
endif()
18151816

18161817
if(NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER AND NOT BUILD_STANDALONE AND
1817-
NOT SWIFT_PREBUILT_CLANG)
1818+
NOT SWIFT_PREBUILT_CLANG AND NOT SWIFTLIB_IS_SWIFT_ONLY)
18181819
list(APPEND SWIFTLIB_DEPENDS clang)
18191820
endif()
18201821

stdlib/public/Cxx/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WINDOWS")
33
set(SWIFT_CXX_LIBRARY_KIND SHARED)
44
endif()
55

6-
add_swift_target_library(swiftCxx ${SWIFT_CXX_LIBRARY_KIND} NO_LINK_NAME IS_STDLIB
6+
add_swift_target_library(swiftCxx ${SWIFT_CXX_LIBRARY_KIND} NO_LINK_NAME IS_STDLIB IS_SWIFT_ONLY
77
CxxConvertibleToCollection.swift
88
CxxDictionary.swift
99
CxxPair.swift

stdlib/public/Cxx/std/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ add_dependencies(sdk-overlay libstdcxx-modulemap)
127127
#
128128
# C++ Standard Library Overlay.
129129
#
130-
add_swift_target_library(swiftCxxStdlib STATIC NO_LINK_NAME IS_STDLIB
130+
add_swift_target_library(swiftCxxStdlib STATIC NO_LINK_NAME IS_STDLIB IS_SWIFT_ONLY
131131
std.swift
132132
String.swift
133133

0 commit comments

Comments
 (0)