Skip to content
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

[cxx-interop] Propagate interop flag to the test entry point target #7428

Merged
merged 1 commit into from Mar 28, 2024

Conversation

egorzhdan
Copy link
Collaborator

Motivation:

Projects that use C++ interop for some of the Swift targets were failing to build in test mode (swift test) because the generated test entry point target wasn't being compiled with C++ interop enabled.

Modifications:

The logic that propagates the C++ interop compiler flag (-cxx-interoperability-mode) to the discovery target now also runs for the entry point target.

rdar://125498997

The generated test entry point target imports the test discovery target, which built with C++ interoperability enabled if any of its dependencies enable C++ interoperability. This logic didn't propagate the C++ interop flag to the entry point target. This triggered build errors that couldn't be worked around easily.

rdar://125498997
@MaxDesiatov
Copy link
Member

@swift-ci test

@egorzhdan egorzhdan merged commit f529dae into main Mar 28, 2024
5 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/cxx-interop-flag-entry-point branch March 28, 2024 13:08
egorzhdan added a commit that referenced this pull request Apr 3, 2024
**Explanation**: Projects that use C++ interop for some of the Swift
targets were failing to build in test mode (`swift test`) because the
generated test entry point target wasn't being compiled with C++ interop
enabled.
**Scope**: Flags that are being passed to the entry point test target.
**Risk**: Low, this only affects projects that explicitly enable C++
interop in the package manifest on non-Darwin platforms only.
**Testing**: Added a build plan test.
**Issue**: rdar://125498997
**Reviewer**: @MaxDesiatov approved
#7428.

(cherry picked from commit f529dae)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants