No need to remove target-specific RUSTFLAGS
Turns out Cargo favors RUSTFLAGS!
This commit is contained in:
parent
7342325dfb
commit
ff6a7c77ae
1 changed files with 3 additions and 5 deletions
|
@ -815,7 +815,7 @@ impl<'a> Builder<'a> {
|
||||||
stage = compiler.stage;
|
stage = compiler.stage;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut rustflags = Rustflags::new(&target, &mut cargo);
|
let mut rustflags = Rustflags::new(&target);
|
||||||
if stage != 0 {
|
if stage != 0 {
|
||||||
rustflags.env("RUSTFLAGS_NOT_BOOTSTRAP");
|
rustflags.env("RUSTFLAGS_NOT_BOOTSTRAP");
|
||||||
} else {
|
} else {
|
||||||
|
@ -1339,18 +1339,16 @@ mod tests;
|
||||||
struct Rustflags(String);
|
struct Rustflags(String);
|
||||||
|
|
||||||
impl Rustflags {
|
impl Rustflags {
|
||||||
fn new(target: &str, cmd: &mut Command) -> Rustflags {
|
fn new(target: &str) -> Rustflags {
|
||||||
let mut ret = Rustflags(String::new());
|
let mut ret = Rustflags(String::new());
|
||||||
|
|
||||||
// Inherit `RUSTFLAGS` by default ...
|
// Inherit `RUSTFLAGS` by default ...
|
||||||
ret.env("RUSTFLAGS");
|
ret.env("RUSTFLAGS");
|
||||||
|
|
||||||
// ... and also handle target-specific env RUSTFLAGS if they're
|
// ... and also handle target-specific env RUSTFLAGS if they're
|
||||||
// configured. If this is configured we also remove it from the
|
// configured.
|
||||||
// environment because Cargo will prefer it over RUSTFLAGS.
|
|
||||||
let target_specific = format!("CARGO_TARGET_{}_RUSTFLAGS", crate::envify(target));
|
let target_specific = format!("CARGO_TARGET_{}_RUSTFLAGS", crate::envify(target));
|
||||||
ret.env(&target_specific);
|
ret.env(&target_specific);
|
||||||
cmd.env_remove(&target_specific);
|
|
||||||
|
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue