Skip to content
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

Idea: Support compilation/cc-rs interface #2873

Open
sagudev opened this issue Jul 28, 2024 · 1 comment
Open

Idea: Support compilation/cc-rs interface #2873

sagudev opened this issue Jul 28, 2024 · 1 comment

Comments

@sagudev
Copy link
Contributor

sagudev commented Jul 28, 2024

When using bindgen for non-system libraries, it's common pattern to also have cc-rs for compilation that gets most flags (include headers, paths, ...) duplicated for bindgen (see mozjs or mozangle for such examples). This is usually migrated by feeding same raw compiler flags for both. It would be nice to only provide all flags once using nicer cc api and then reuse them for bindgen. Or simply offer compilation as part of bindgen (maybe benefiting because static analysis is not run twice).

@pvdrz
Copy link
Contributor

pvdrz commented Aug 21, 2024

In principle, it would be good enough if cc could provide the flags passed to the C compiler somehow as then you could feed them as clang_args to bindgen.

Whether or not it is possible to turn bindgen into a proper compiler depends on whether or not libclang is able to take a translation unit and turn it into an actual binary somehow, but afaik libclang does not provide such functionality.

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