Skip to content

Commit

Permalink
Only set *FLAGS env vars if they are not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Apr 24, 2020
1 parent 0658259 commit 08c8996
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1405,8 +1405,16 @@ impl Cargo {

impl From<Cargo> for Command {
fn from(mut cargo: Cargo) -> Command {
cargo.command.env("RUSTFLAGS", &cargo.rustflags.0);
cargo.command.env("RUSTDOCFLAGS", &cargo.rustdocflags.0);
let rustflags = &cargo.rustflags.0;
if !rustflags.is_empty() {
cargo.command.env("RUSTFLAGS", rustflags);
}

let rustdocflags = &cargo.rustdocflags.0;
if !rustdocflags.is_empty() {
cargo.command.env("RUSTDOCFLAGS", rustdocflags);
}

cargo.command
}
}

0 comments on commit 08c8996

Please sign in to comment.