File tree 1 file changed +10
-5
lines changed
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> {
698
698
let out_dir = self . stage_out ( compiler, mode) ;
699
699
cargo
700
700
. 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
+ }
704
709
705
710
// Set a flag for `check` so that certain build scripts can do less work
706
711
// (e.g. not building/requiring LLVM).
@@ -1022,8 +1027,8 @@ impl<'a> Builder<'a> {
1022
1027
}
1023
1028
1024
1029
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" {
1027
1032
cargo. arg ( "--release" ) ;
1028
1033
}
1029
1034
}
You can’t perform that action at this time.
0 commit comments