Skip to content

[cxx-interop] Use macosx paths when searching modulemaps for macCatalyst #76735

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
Sep 27, 2024

Conversation

drodriguez
Copy link
Contributor

The existing code will use paths for "iphoneos" because the triples for macCatalyst are in the form "-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.

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
Copy link
Contributor Author

@swift-ci please test

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Sep 27, 2024
Copy link
Contributor

@egorzhdan egorzhdan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@drodriguez drodriguez merged commit fe796b4 into swiftlang:main Sep 27, 2024
5 checks passed
@drodriguez drodriguez deleted the maccatalyst-module-path branch September 27, 2024 17:08
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