Skip to content

🍒[cxx-interop] Include Cxx and CxxStdlib modules in no-stdlib builds #65065

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 3 commits into from
Apr 14, 2023

Conversation

egorzhdan
Copy link
Contributor

@egorzhdan egorzhdan commented Apr 11, 2023

Explanation: This ensures that the Cxx and CxxStdlib binaries are compiled and installed correctly when building the stdlib separately from the compiler. These two modules are shipped with the toolchain, not with the SDK, so they need to be built along with the compiler. This also removes the unnecessary dependency on clang for these two modules.
Scope: Only affects clients which enable Swift/C++ interop.
Risk: Low: C++ interop is an opt-in feature that is enabled via a compiler flag. It is off by default.

rdar://107840627

These modules are shipped with the toolchain, while the stdlib might be built and shipped separately.

rdar://107780733
(cherry picked from commit d95215d)
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
(cherry picked from commit 14f3231)
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Apr 11, 2023
@egorzhdan egorzhdan requested a review from a team as a code owner April 11, 2023 16:08
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@zoecarver zoecarver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know this code, but it looks great! Hopefully this fixes it 😅

This adds the ability to control the C++ interop module in the -stdlib
build separately from "extra toolchain content".  This is helpful for
Windows where we bootstrap the entire toolchain and do not have a stdlib
built when building tools.

(cherry picked from commit 435d4b4)
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@egorzhdan
Copy link
Contributor Author

@swift-ci please test Linux

@egorzhdan egorzhdan merged commit ff43be9 into release/5.9 Apr 14, 2023
@egorzhdan egorzhdan deleted the egorzhdan/5.9-cmake-cxx-toolchain branch April 14, 2023 01:24
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++ 🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants