-
Notifications
You must be signed in to change notification settings - Fork 466
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
Add Build::from_cargo
or similar to make it very explicit when in a build script
#1219
Comments
Actually, I think my biggest issue is the ad-hoc parsing of the target triple; ideally, that would be done first thing inside Would you accept a PR changing the target parsing to be up-front? And would you accept a private dependency on |
Yeah I think having a new method calls
I think target-lexicon is small enough, as long as the serde feature is not enabled it should be ok to include it. |
Hmm, I realized that I have opened bytecodealliance/target-lexicon#112 to track that, not sure whether I will start on this in |
cc
's code is littered with brittle checks centered onrustc
target triple. A lot of this is unnecessary though, since Cargo setscfg
values for the target as environment variables, see the docs for more examples.cc
can't actually use those in most cases though, since it doesn't know whether it's being run inside a Cargo build script, or outside of it.A prominent example is that
CARGO_CFG_TARGET_ABI
would be very useful for detecting Apple's simulator targets (doing it based on the target name is misery, and I think we're currently doing it wrong some places).So I got to thinking, would it make sense to "split"
cc
's entry point into two, and deprecatedcc::Build::new
? Something like:The text was updated successfully, but these errors were encountered: