Skip to content

[cxx-interop] Build the C++ stdlib overlay when SWIFT_BUILD_SDK_OVERLAY=NO #63865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/public/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ endif()

add_subdirectory(SwiftShims/swift/shims)
add_subdirectory(CommandLineSupport)
add_subdirectory(Cxx)
add_subdirectory(Threading)

# This static library is shared across swiftCore and swiftRemoteInspection
Expand Down Expand Up @@ -159,7 +160,6 @@ endif()

if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
add_subdirectory(Platform)
add_subdirectory(Cxx)
endif()

if(SWIFT_BUILD_SDK_OVERLAY)
Expand Down
4 changes: 3 additions & 1 deletion stdlib/public/Cxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ add_swift_target_library(swiftCxx ${SWIFT_CXX_LIBRARY_KIND} NO_LINK_NAME IS_STDL
INSTALL_IN_COMPONENT compiler
INSTALL_WITH_SHARED)

add_subdirectory(std)
if(SWIFT_BUILD_SDK_OVERLAY OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
add_subdirectory(std)
endif()
add_subdirectory(cxxshim)
5 changes: 3 additions & 2 deletions stdlib/public/Cxx/cxxshim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@ foreach(sdk ${SWIFT_SDKS})

swift_install_in_component(FILES libcxxshim.modulemap libcxxshim.h
DESTINATION "lib/swift/${arch_subdir}"
COMPONENT sdk-overlay)
COMPONENT compiler)
if(SWIFT_BUILD_STATIC_STDLIB)
swift_install_in_component(FILES libcxxshim.modulemap libcxxshim.h
DESTINATION "lib/swift_static/${arch_subdir}"
COMPONENT sdk-overlay)
COMPONENT compiler)
endif()
endforeach()
endforeach()

add_custom_target(libcxxshim_modulemap DEPENDS ${libcxxshim_modulemap_target_list})
set_property(TARGET libcxxshim_modulemap PROPERTY FOLDER "Miscellaneous")
add_dependencies(sdk-overlay libcxxshim_modulemap)
add_dependencies(compiler libcxxshim_modulemap)