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

gen: allow for cfg_evaluator to be set in cxx_gen #1334

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

ahayzen-kdab
Copy link
Contributor

This allows for users of cxx_gen to choose a cfg_evaluator, otherwise they cannot have cfg attributes in bridges.

This allows for users of cxx_gen to choose a cfg_evaluator,
otherwise they cannot have cfg attributes in bridges.
@ahayzen-kdab
Copy link
Contributor Author

When using cxx_gen::generate_header_and_cc https://docs.rs/cxx-gen/latest/cxx_gen/fn.generate_header_and_cc.html we can supply an Opt but the cfg_evaluator is not public and it defaults to UnsupportedCfgEvaluator.

This means that when using just cxx_gen you cannot support #[cfg(...)] in CXX bridges, by making this field public we can then set our own evaluator and support cfg attributes in bridges.

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

@dtolnay dtolnay merged commit 38b5842 into dtolnay:master Apr 8, 2024
17 checks passed
@dtolnay
Copy link
Owner

dtolnay commented Apr 8, 2024

Published in cxx-gen 0.7.121.

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.

2 participants