File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,10 @@ impl Metadata {
281
281
let rustflags =
282
282
toml:: to_string ( & self . rustc_args ) . expect ( "serializing a string should never fail" ) ;
283
283
cargo_args. push ( format ! ( "build.rustflags={}" , rustflags) ) ;
284
+ cargo_args. push ( "-Zhost-config" . into ( ) ) ;
285
+ cargo_args. push ( "-Ztarget-applies-to-host" . into ( ) ) ;
286
+ cargo_args. push ( "--config" . into ( ) ) ;
287
+ cargo_args. push ( format ! ( "host.rustflags={}" , rustflags) ) ;
284
288
}
285
289
286
290
if !all_rustdoc_args. is_empty ( ) {
Original file line number Diff line number Diff line change @@ -1081,4 +1081,16 @@ mod tests {
1081
1081
Ok ( ( ) )
1082
1082
} ) ;
1083
1083
}
1084
+
1085
+ #[ test]
1086
+ #[ ignore]
1087
+ fn test_rustflags_are_passed_to_build_script ( ) {
1088
+ wrapper ( |env| {
1089
+ let crate_ = "proc-macro2" ;
1090
+ let version = "1.0.33" ;
1091
+ let mut builder = RustwideBuilder :: init ( env) . unwrap ( ) ;
1092
+ assert ! ( builder. build_package( crate_, version, PackageKind :: CratesIo ) ?) ;
1093
+ Ok ( ( ) )
1094
+ } ) ;
1095
+ }
1084
1096
}
You can’t perform that action at this time.
0 commit comments