-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add crate features to check cxx version command #598
base: master
Are you sure you want to change the base?
Conversation
Is this fix sufficient? In particular are the generated bindings correct, even without us passing any features to the actual If |
I noticed that, too. The cxxbridge command would also need to be able to accept a list of features, but I have not really looked into this yet as this is not corrosion specific. The goal would be to achieve being able to add a conditional flag above #[cfg(feature = "interop")]
#[cxx::bridge]
mod ffi {
// ...
} For me, this PR to corrosion was "enough" to solve my issue because I added |
In theory, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon second thought, I realized we can't merge this as is.
The reason is that Corrosion explicitly allows the features to contain CMake Generator expressions. Since execute_process
runs at configure time, we can't use generator expressions here (at least not without more changes).
As a quick fix, I think we could just pass --all-features
unconditionally.
What do you think?
Yes, passing However, how does the |
it basically maps to |
Adds the supplied crate features to the cxx version check command so it does not fail when the cxx dependency is made optional and locked behind a feature flag.
Fixes #597