-
Notifications
You must be signed in to change notification settings - Fork 307
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
Integrate better with bindgen #68
Comments
I think an optimal solution could be: # config.rs
[rust-bindgen]
mod = "generated"
header = "source.h" We would then flag every item in This depends on refactoring |
If cbindgen finds an undefined type, it will just ignore it, instead of failing? |
It will generate a warning in the console, but it won't fail to generate a header. In the future it might. If you want to use this to not generate a definition for a type, you'll need some way of hiding it from cbindgen but not from rustc. Or maybe generating the definitition after cbindgen runs. |
I'm going to close this now as it's not clear what action is required here. |
Currently if you need to define an item in C/C++ and use it from Rust, you can use
rust-bindgen
and it will output the Rust definition for you.This is problematic if that type needs to be used in a Rust FFI boundary, as
cbindgen
will try to output a second C/C++ definition for that type, which will cause errors.I believe that if
cbindgen
is run beforebindgen
, we'll do the right thing and not output a definition for those items, but you will need to ensure you include the proper C/C++ files before the generated header.I just added an annotation
no-export
which will prevent a type from being given a definition in the output header, which can help with this, but isn't optimal.The text was updated successfully, but these errors were encountered: