File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -698,9 +698,14 @@ impl<'a> Builder<'a> {
698698 let out_dir = self . stage_out ( compiler, mode) ;
699699 cargo
700700 . env ( "CARGO_TARGET_DIR" , out_dir)
701- . arg ( cmd)
702- . arg ( "--target" )
703- . arg ( target) ;
701+ . arg ( cmd) ;
702+
703+ if cmd != "install" {
704+ cargo. arg ( "--target" )
705+ . arg ( target) ;
706+ } else {
707+ assert_eq ! ( target, compiler. host) ;
708+ }
704709
705710 // Set a flag for `check` so that certain build scripts can do less work
706711 // (e.g. not building/requiring LLVM).
@@ -1022,8 +1027,8 @@ impl<'a> Builder<'a> {
10221027 }
10231028
10241029 if self . config . rust_optimize {
1025- // FIXME: cargo bench does not accept `--release`
1026- if cmd != "bench" {
1030+ // FIXME: cargo bench/install do not accept `--release`
1031+ if cmd != "bench" && cmd != "install" {
10271032 cargo. arg ( "--release" ) ;
10281033 }
10291034 }
You can’t perform that action at this time.
0 commit comments