Skip to content

Commit 14f3231

Browse files
committed
[cxx-interop] Do not add a dependency on clang to CxxStdlib
Cxx & CxxStdlib modules are Swift-only, they do not require invoking clang directly. When building with `SWIFT_INCLUDE_TOOLS=NO`, Clang is not available as a CMake target (see `swift_common_standalone_build_config`). rdar://107780733
1 parent d95215d commit 14f3231

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

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)