diff options
| author | kennytm <kennytm@gmail.com> | 2018-01-30 17:10:57 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-30 17:10:57 +0800 |
| commit | e8868bdc5613de10f83247094be8bbd84a053773 (patch) | |
| tree | 2a5f2e8118c54b7bbb7bfb6807d67e7b8f7ec0cf /src/bootstrap | |
| parent | 16d3fdb752bdc08e18c93a048d2aa965348fd17a (diff) | |
| parent | e09a8bd70c4804234af900f19fbb883045ba8d0d (diff) | |
| download | rust-e8868bdc5613de10f83247094be8bbd84a053773.tar.gz rust-e8868bdc5613de10f83247094be8bbd84a053773.zip | |
Rollup merge of #47836 - Mark-Simulacrum:stage-flags, r=alexcrichton
Add per-stage RUSTFLAGS: RUSTFLAGS_STAGE_{0,1,2} and RUSTFLAGS_STAGE_NOT_0
Fixes #47658.
r? @alexcrichton
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/builder.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 79058984b13..1272643edd2 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -469,6 +469,18 @@ impl<'a> Builder<'a> { stage = compiler.stage; } + let mut extra_args = env::var(&format!("RUSTFLAGS_STAGE_{}", stage)).unwrap_or_default(); + if stage != 0 { + let s = env::var("RUSTFLAGS_STAGE_NOT_0").unwrap_or_default(); + extra_args.push_str(" "); + extra_args.push_str(&s); + } + + if !extra_args.is_empty() { + cargo.env("RUSTFLAGS", + format!("{} {}", env::var("RUSTFLAGS").unwrap_or_default(), extra_args)); + } + // Customize the compiler we're running. Specify the compiler to cargo // as our shim and then pass it some various options used to configure // how the actual compiler itself is called. |
