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 {
10931093 let target = self . get_target ( ) ?;
10941094
10951095 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" } ) ;
11001097
11011098 // Disable default flag generation via environment variable or when
11021099 // certain cross compiling arguments are set
11031100 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| {
11061102 arg. starts_with ( "-m" ) || arg. starts_with ( "/arch" ) || arg. starts_with ( "--target" )
11071103 } ) ) ;
11081104
@@ -1385,6 +1381,10 @@ impl Build {
13851381 println ! ( "Info: default compiler flags are disabled" ) ;
13861382 }
13871383
1384+ for arg in envflags {
1385+ cmd. push_cc_arg ( arg. into ( ) ) ;
1386+ }
1387+
13881388 for directory in self . include_directories . iter ( ) {
13891389 cmd. args . push ( cmd. family . include_flag ( ) . into ( ) ) ;
13901390 cmd. args . push ( directory. into ( ) ) ;
You can’t perform that action at this time.
0 commit comments