-
Notifications
You must be signed in to change notification settings - Fork 45
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
Put methods behind feature flags #328
Conversation
Awesome, thanks for starting on this! |
I made some additions in a local branch at https://github.com/silvanshade/objc2/tree/icrate-behind-feature-flags. It's able to automatically emit the features to the
In any case, may not be the best way to do things but feel free to use any of that if it's useful. |
4e367b7
to
d614bd4
Compare
Thanks, I started from what you had and have gotten feature emission to work now (not currently updated in-branch). |
Emit features to Cargo.toml
d614bd4
to
0274b5f
Compare
e01685b
to
2d0e590
Compare
So wrt. compilation-time improvements (approximate numbers):
Tested with: CMD=cargo +nightly build -picrate --features Foundation # or `check` or `build --release`
$CMD
cargo clean -picrate
$CMD Which tells me that this is a definite improvement (and not even a regression when enabling many features), and it is definitely good enough for me to actually start using it in |
a12addf
to
bea5c51
Compare
3609945
to
fd61fe6
Compare
46b3e90
to
ec2406c
Compare
6153632
to
933b09c
Compare
Fixes #311.
A few manual fixes are still necessary to handle structs and typedefs that use class types, and the user has to specify e.g.
["Foundation", "Foundation_NSString"]
instead of just["Foundation_NSString"]
, but it should be workable.