Skip to content

BINDGEN_EXTRA_CLANG_ARGS_<TARGET> does not document how can be formatted the TARGET #3183

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

Open
jadinm opened this issue Apr 3, 2025 · 0 comments

Comments

@jadinm
Copy link

jadinm commented Apr 3, 2025

Hello :)

At the moment, Bindgen does not document in its readme that in BINDGEN_EXTRA_CLANG_ARGS_ is either the target value or the target with hyphens replaced by underscores.

This is confusing because without any indication, we are tempted to think that bindgen works like cargo config (see https://doc.rust-lang.org/cargo/reference/config.html#environment-variables) but that's not the case.

For instance, the following does not work (while it would for cargo):

$ BINDGEN_EXTRA_CLANG_ARGS_X86_64_UNKNOWN_LINUX_GNU=-v bindgen ...

What bindgen supports is:

$ BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_gnu=-v bindgen ...

It would be nice if you could document the format in the README :-)

Maybe it would also be cool to support uppercase targets by modifying get_target_dependent_env_var().

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

1 participant