-
Notifications
You must be signed in to change notification settings - Fork 315
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 whitelist to [export] #484
Comments
So like |
Using features should work, as long as you define it in the features section. It should generate |
According to the documentation
Maybe this isn't true? I can only find "features" under |
Imagine that I have something like this in my crate:
If I then build with |
Err, I meant the So when you do something like:
You'll get something like:
And so on. |
cool, that might be exactly what we need. I'll try it out |
I tested it, and it doesn't work exactly as I hoped. Is it possible tto generate Relying on |
Now I noticed that you cannot have |
It is not impossible.
As a workaround you could have something like the following in the header:
And so on, but that seems slightly annoying indeed.
Well, you can have them in |
Thanks, with those two workarounds it works OK for us for now. This ended up being our final cbindgen config.
Thanks for cbindgen and thanks for the quick responses! |
Actually the problem that I have is that my bindgen symbols are being re-exported by cbindgen. I use the bindgen as |
@dzervas it may be you want |
I'm not sure if this should be a separate issue, but it sounded fairly close to this one. I've wished for a way to only export functions, types, and constants from a specific module. (In my case, I put all the relevant things to export in It's also a little different than [export]
only = ["ffi::*"] |
Currently functions are generated without |
Hi
By default cbindgen exports everything, and a blacklist can be added by setting
exclude
in the[export]
section.In my current use, it would be great if I could set a whitelist instead of a blacklist, as I'd like to export subsets of the crate depending on the compilation target.
In general I like explicit lists (whitelist) over implicit lists (blacklist).
We also tried using feature attributes to enable/disable functions based on the target, but that did not seem work.
cc @NickeZ
The text was updated successfully, but these errors were encountered: