Skip to content

Don't generate bindings for all headers #1788

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

Closed
thatbakamono opened this issue May 17, 2020 · 1 comment
Closed

Don't generate bindings for all headers #1788

thatbakamono opened this issue May 17, 2020 · 1 comment

Comments

@thatbakamono
Copy link

thatbakamono commented May 17, 2020

Is there an easy way to tell bindgen to not generate bindings to libc or winapi? I don't wanna do --blacklist-type and --blacklist-function like 30000 times (I can't really use --whitelist-type or --whitelist-function because there is no pattern in these names).
If not, I would propose to add something like --whitelist-header and --blacklist-header, example: --blacklist-header windows.h (It will ignore only this particular header, not all headers used by that header)

@emilio
Copy link
Contributor

emilio commented May 19, 2020

The problem with this is two:

  • A C type can come from multiple headers, either via forward declarations, or via duplicate typedefs or signatures. So it's a bit tricky.

  • Bindgen would still have to parse the whole thing anyway.

But this is not impossible, just a bit hard and with edge cases all over the place. This is in any case a dupe of #303.

@emilio emilio closed this as completed May 19, 2020
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

No branches or pull requests

2 participants