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

Observe CARGO_CFG_TARGET_* in build.rs #322

Closed
briansmith opened this issue Oct 26, 2016 · 2 comments
Closed

Observe CARGO_CFG_TARGET_* in build.rs #322

briansmith opened this issue Oct 26, 2016 · 2 comments
Milestone

Comments

@briansmith
Copy link
Owner

In particular, the CARGO_CFG_TARGET_FEATURE variable should be used to help with the CRT stuff on Windows. Note "After this change, the gcc-rs crate will be modified to check for the CARGO_CFG_TARGET_FEATURE directive, and parse it into a list of enabled features."

These look like they'd be useful in our build.rs:

export CARGO_CFG_TARGET_OS=linux
export CARGO_CFG_TARGET_FAMILY=unix
export CARGO_CFG_TARGET_ARCH=x86_64
export CARGO_CFG_TARGET_ENDIAN=little
export CARGO_CFG_TARGET_POINTER_WIDTH=64
export CARGO_CFG_TARGET_ENV=gnu
export CARGO_CFG_UNIX
export CARGO_CFG_DEBUG_ASSERTIONS
export CARGO_CFG_TARGET_FEATURE=sse,crt-static

In particular, if we add the dependency on the target_build_utils crate in #321, then we might be able to remove that dependency by using these variables.

@briansmith
Copy link
Owner Author

This depends on rust-lang/rust#37406.

@briansmith
Copy link
Owner Author

It seems like Cargo is passing in these variables and we're able to use them. This was done in 5c77732.

@briansmith briansmith added this to the 0.7.n milestone Mar 6, 2017
@briansmith briansmith modified the milestones: 0.7.n, 0.7.3 Mar 20, 2017
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