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

[C++ interop] A Swift executable target that depends on a Swift library target that enables C++ interop should tell Swift to link using clang++, even when C++ interop is not enabled in the executable target #6564

Open
hyp opened this issue May 16, 2023 · 0 comments
Assignees
Labels

Comments

@hyp
Copy link
Contributor

hyp commented May 16, 2023

Description

C++ interoperability can be enabled using the new .interoperabilityMode(.Cxx) setting.
We want to support a case where a Swift library target can enable C++ interoperability, but still be imported into another Swift target that doesn't enable C++ interoperability. That works today now that swiftlang/swift#65948 is fixed.
However, when an executable Swift target that depends on such Swift target gets linked, it doesn't use clang++ to link, i.e. it thinks that it can link the program as if C++ interop was not enabled in the entire dependency tree.

Expected behavior

SwiftPM should detect when an executableTarget depends on a Swift target that enables C++ interop and pass a flag to Swift driver that tells it that it should link as if interop is enabled.

Actual behavior

No response

Steps to reproduce

No response

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version ; uname -a)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant