File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1093,16 +1093,12 @@ impl Build {
1093
1093
let target = self . get_target ( ) ?;
1094
1094
1095
1095
let mut cmd = self . get_base_compiler ( ) ?;
1096
-
1097
- for arg in self . envflags ( if self . cpp { "CXXFLAGS" } else { "CFLAGS" } ) {
1098
- cmd. push_cc_arg ( arg. into ( ) ) ;
1099
- }
1096
+ let envflags = self . envflags ( if self . cpp { "CXXFLAGS" } else { "CFLAGS" } ) ;
1100
1097
1101
1098
// Disable default flag generation via environment variable or when
1102
1099
// certain cross compiling arguments are set
1103
1100
let use_defaults = self . getenv ( "CRATE_CC_NO_DEFAULTS" ) . is_none ( )
1104
- && !( cmd. args . iter ( ) . any ( |ref a| {
1105
- let arg = a. to_str ( ) . unwrap_or ( "" ) ;
1101
+ && !( envflags. iter ( ) . any ( |ref arg| {
1106
1102
arg. starts_with ( "-m" ) || arg. starts_with ( "/arch" ) || arg. starts_with ( "--target" )
1107
1103
} ) ) ;
1108
1104
@@ -1385,6 +1381,10 @@ impl Build {
1385
1381
println ! ( "Info: default compiler flags are disabled" ) ;
1386
1382
}
1387
1383
1384
+ for arg in envflags {
1385
+ cmd. push_cc_arg ( arg. into ( ) ) ;
1386
+ }
1387
+
1388
1388
for directory in self . include_directories . iter ( ) {
1389
1389
cmd. args . push ( cmd. family . include_flag ( ) . into ( ) ) ;
1390
1390
cmd. args . push ( directory. into ( ) ) ;
You can’t perform that action at this time.
0 commit comments