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

zig: do not overwrite bindgen env vars if already set #126

Merged
merged 1 commit into from
Apr 15, 2023
Merged

zig: do not overwrite bindgen env vars if already set #126

merged 1 commit into from
Apr 15, 2023

Conversation

lriesebos
Copy link
Contributor

see #74 (comment)

basically, BINDGEN_EXTRA_CLANG_ARGS_<target> was always set (i.e. overwritten) even if the env variable was already set by the user. this target-specific env variable also precedes BINDGEN_EXTRA_CLANG_ARGS which becomes powerless. as a result, users were not able to pass their own arguments to clang for bindgen through env variables.

this fix checks if BINDGEN_EXTRA_CLANG_ARGS or BINDGEN_EXTRA_CLANG_ARGS_<target> was already set. if it was set by the user, cargo-zigbuild will not overwrite those values and leave them as is.
if both env vars are not set, cargo-zigbuild will keep its existing behavior by setting the clang sysroot.

Copy link
Member

@messense messense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@messense messense merged commit 0f29051 into rust-cross:main Apr 15, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants