feat(examples): make -cxx-interoperability-mode a feature #1567
+116
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
-cxx-interoperability-mode currently needs to be passed as copts to targets who depend on C++ code, as seen in
examples/xplatform/cxx_from_swift.
This works in simple cases, but it currently fails if the
swift_symbol_graph_aspect
is applied on this target, as copts are not propagated to this action (rightfully, as not all copts will work).So in order to make it work, we're turning this flag into a feature, and we add corresponding action configs to both the compile action and to the symbol_graph_extract action.
We're also enhancing the cxx_from_swift test by testing for this case. We're doing so by doing the following changes:
This test will fail if -cxx-interoperability-mode=default is not passed to swift-symbolgraph-extract.