Skip to content

[cxx-interop] Build Cxx and CxxStdlib modules for macCatalyst #74994

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 1 commit into from
Jul 8, 2024

Conversation

egorzhdan
Copy link
Contributor

This enables building the C++ stdlib overlays (Cxx.swiftmodule and CxxStdlib.swiftmodule) for the Mac Catalyst target.

rdar://126938813

This enables building the C++ stdlib overlays (`Cxx.swiftmodule` and `CxxStdlib.swiftmodule`) for the Mac Catalyst target.

rdar://126938813
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jul 5, 2024
@egorzhdan egorzhdan requested review from Xazax-hun and DougGregor July 5, 2024 18:37
@egorzhdan egorzhdan requested review from zoecarver and hyp as code owners July 5, 2024 18:37
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

LGTM!

@egorzhdan egorzhdan merged commit 71c81d5 into main Jul 8, 2024
5 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/cxx-overlay-maccatalyst branch July 8, 2024 11:11
egorzhdan added a commit that referenced this pull request Sep 4, 2024
This is a follow-up after the change that enabled Cxx and CxxStdlib overlays on macCatalyst: #74994.

The compiler relies on the presence of these shim libraries in the toolchain.

rdar://135275773
drodriguez added a commit to drodriguez/swift that referenced this pull request Sep 26, 2024
The existing code will use paths for "iphoneos" because the triples for
macCatalyst are in the form "<arch>-apple-iosXX.yy-macabi", which the
code interprets as an iPhone triple. This seems to work in Xcode because
the "iphoneos" folder is always there. When building in open source,
this seems to work because it is also normal to have the iPhone SDK
configured. This is not the case if you want to build the macOS SDK in
isolation.

The code changes detect the macCatalyst environment from the triple and
use the "macosx" paths instead, otherwise it follows the same code path
as before. This matches many places in the CMakeLists.txt files in which
macCatalyst support pieces are only enabled when the SDK is macOS.

The modified function is also used for the libc modulemap of non-Darwin
platforms, but for those triples, the macCatalyst environment should not
be detected, so the libc modulemap should not be affected by this
change.

This is a followup to swiftlang#76260 and swiftlang#74994.
drodriguez added a commit that referenced this pull request Sep 27, 2024
…yst (#76735)

The existing code will use paths for "iphoneos" because the triples for
macCatalyst are in the form "<arch>-apple-iosXX.yy-macabi", which the
code interprets as an iPhone triple. This seems to work in Xcode because
the "iphoneos" folder is always there. When building in open source,
this seems to work because it is also normal to have the iPhone SDK
configured. This is not the case if you want to build the macOS SDK in
isolation.

The code changes detect the macCatalyst environment from the triple and
use the "macosx" paths instead, otherwise it follows the same code path
as before. This matches many places in the CMakeLists.txt files in which
macCatalyst support pieces are only enabled when the SDK is macOS.

The modified function is also used for the libc modulemap of non-Darwin
platforms, but for those triples, the macCatalyst environment should not
be detected, so the libc modulemap should not be affected by this
change.

This is a followup to #76260 and #74994.
drodriguez added a commit to drodriguez/swift that referenced this pull request Sep 30, 2024
The existing CMake code for macCatalyst swiftmodule only handled the
shared case, and did not have the static pieces that non-macCatalyst
targets are doing.

Try to match as much as possible the non-macCatalyst variables and
structure and allow macCatalyst targets to support static Swift targets.

This is important for the `Cxx.swiftmodule` and `CxxStdlib.swiftmodule`,
since they are only static, and the previous code skipped creating those
files since swiftlang#74994
drodriguez added a commit to drodriguez/swift that referenced this pull request Oct 21, 2024
The existing CMake code for macCatalyst swiftmodule only handled the
shared case, and did not have the static pieces that non-macCatalyst
targets are doing.

Try to match as much as possible the non-macCatalyst variables and
structure and allow macCatalyst targets to support static Swift targets.

This is important for the `Cxx.swiftmodule` and `CxxStdlib.swiftmodule`,
since they are only static, and the previous code skipped creating those
files since swiftlang#74994
drodriguez added a commit that referenced this pull request Oct 22, 2024
The existing CMake code for macCatalyst swiftmodule only handled the
shared case, and did not have the static pieces that non-macCatalyst
targets are doing.

Try to match as much as possible the non-macCatalyst variables and
structure and allow macCatalyst targets to support static Swift targets.

This is important for the `Cxx.swiftmodule` and `CxxStdlib.swiftmodule`,
since they are only static, and the previous code skipped creating those
files since #74994
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++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants