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

Unset CFLAGS, CPPFLAGS and CXXFLAGS in build.rs #1

Open
fabricedesre opened this issue Apr 22, 2020 · 1 comment
Open

Unset CFLAGS, CPPFLAGS and CXXFLAGS in build.rs #1

fabricedesre opened this issue Apr 22, 2020 · 1 comment

Comments

@fabricedesre
Copy link

If they are set to match a cross compilation target, they end up being used by the host compilation in build.rs . This doesn't end well :)

fabricedesre added a commit to kaiostech/gecko-b2g that referenced this issue Apr 22, 2020
@jamienicol
Copy link
Owner

Happy to merge something like this, it's no worse than what we're already doing :). If anyone using this library actually needs to pass flags they could still use the HOST_CFLAGS var. Ideally one day rust-lang/cargo#5755 will remove the need for hacks like this.

I think we should be consistent in the variables which we ignore. So if gonk needs to ignore CPPFLAGS, lets also remove format!("CXXFLAGS_{}", &target) and format!("CPPFLAGS_{}", target.replace("-", "_"))

You could also avoid this issue by ensuring that any of CFLAGS_$HOST (eg CFLAGS_x86_64-unknown-linux-gnu), or the same with underscores instead of hyphens, or HOST_CFLAGS, are set, as those would take precedence over CFLAGS. Not sure if that would be easier for you?

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