Skip to content

Commit

Permalink
make it possible to add args to cargo in x.py
Browse files Browse the repository at this point in the history
eg. make it easier to test -Ztimings for rustc
  • Loading branch information
andjo403 committed Oct 9, 2019
1 parent 7870050 commit 6ae36a3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/bootstrap/builder.rs
Expand Up @@ -817,12 +817,22 @@ impl<'a> Builder<'a> {

let mut rustflags = Rustflags::new(&target);
if stage != 0 {
if let Ok(s) = env::var("CARGOFLAGS_NOT_BOOTSTRAP") {
cargo.args(s.split_whitespace());
}
rustflags.env("RUSTFLAGS_NOT_BOOTSTRAP");
} else {
if let Ok(s) = env::var("CARGOFLAGS_BOOTSTRAP") {
cargo.args(s.split_whitespace());
}
rustflags.env("RUSTFLAGS_BOOTSTRAP");
rustflags.arg("--cfg=bootstrap");
}

if let Ok(s) = env::var("CARGOFLAGS") {
cargo.args(s.split_whitespace());
}

match mode {
Mode::Std | Mode::ToolBootstrap | Mode::ToolStd => {},
Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {
Expand Down

0 comments on commit 6ae36a3

Please sign in to comment.