Skip to content

Commit a1ed90e

Browse files
authored
Merge pull request #65222 from drodriguez/isolated-stdlib-builds-5.9
build: Fixes for building Cxx w/, w/o stdlib
2 parents 44d43c4 + 4f071ba commit a1ed90e

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 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)
@@ -1287,7 +1287,7 @@ else()
12871287

12881288
# Some tools (e.g. swift-reflection-dump) rely on a host swiftRemoteInspection,
12891289
# so ensure we build that when building tools.
1290-
if(SWIFT_INCLUDE_TOOLS)
1290+
if(SWIFT_INCLUDE_TOOLS OR SWIFT_BUILD_STDLIB_CXX_MODULE)
12911291
add_subdirectory(stdlib/public/SwiftShims/swift/shims)
12921292
endif()
12931293

stdlib/public/Cxx/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../cmake/modules)
2+
include(StdlibOptions)
3+
14
set(SWIFT_CXX_LIBRARY_KIND STATIC)
25
if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WINDOWS")
36
set(SWIFT_CXX_LIBRARY_KIND SHARED)
47
endif()
58

9+
set(SWIFT_CXX_DEPS symlink_clang_headers)
10+
if(SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT)
11+
list(APPEND SWIFT_CXX_DEPS copy-legacy-layouts)
12+
endif()
13+
614
add_swift_target_library(swiftCxx ${SWIFT_CXX_LIBRARY_KIND} NO_LINK_NAME IS_STDLIB IS_SWIFT_ONLY
715
CxxConvertibleToCollection.swift
816
CxxDictionary.swift
@@ -20,6 +28,7 @@ add_swift_target_library(swiftCxx ${SWIFT_CXX_LIBRARY_KIND} NO_LINK_NAME IS_STDL
2028
-Xcc -nostdinc++
2129

2230
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
31+
DEPENDS ${SWIFT_CXX_DEPS}
2332
INSTALL_IN_COMPONENT compiler
2433
INSTALL_WITH_SHARED)
2534

0 commit comments

Comments
 (0)