-
Notifications
You must be signed in to change notification settings - Fork 153
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
Experiment with generating all #75
Comments
|
I think there could be a worthwhile middle ground here: Generate bindings not for everything, but for all definitions contained directly in the headers mentioned in the This would be in the spirit of "include what you use". It would also avoid producing the really large amounts of output that a true "generate all" might produce on a header that pulls in a lot of definitions through transitive includes. It would, however, require some modifications to bindgen, I think. BTW, should the title of this bug be renamed to "Experiment with |
Thanks for the suggestion. I hadn't thought of it, but I'd be a bit concerned that some projects might expose a "logical" header to their clients which actually just |
Hm, that's true. Essentially, this would require something akin to Probably, the only good solution to this is to use C++ modules, which make all of this explicit, but this doesn't seem worth doing before C++ modules come into widespread use. It might still be worth offering this a "generate all from header" option for use in projects that have a convention that only declarations from a header itself should be used. |
OK, I had a crack at this today in #438. Conclusions:
autocxx::include_cpp! {
#include "foo.h"
} ... but that conflicts with the current POD declaration style.
|
At the moment, it's mandatory to provide one or more
allow
directives. They builds the allowlist which we feed to bindgen. However, if no allowlist is fed to bindgen it attempts to generate bindings for everything which it encounters in the header files.It might be worth adding an
allow_all
directive which bypasses the creation of theNoAllowlist
error but has no other effect: this should be sufficient to ask bindgen to generate bindings for everything.In practice, with realistically complex headers (i.e. using STL), I expect problems correctly interpreting some of the items in the headers. But that's probably a good reason to try.
The text was updated successfully, but these errors were encountered: