@@ -250,6 +250,7 @@ impl Mode {
250
250
}
251
251
}
252
252
253
+ #[ derive( Debug , Hash , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
253
254
pub enum CLang {
254
255
C ,
255
256
Cxx ,
@@ -1187,9 +1188,9 @@ Executed at: {executed_at}"#,
1187
1188
self . cc . borrow ( ) [ & target] . path ( ) . into ( )
1188
1189
}
1189
1190
1190
- /// Returns a list of flags to pass to the C compiler for the target
1191
- /// specified.
1192
- fn cflags ( & self , target : TargetSelection , which : GitRepo , c : CLang ) -> Vec < String > {
1191
+ /// Returns C flags that `cc-rs` thinks should be enabled for the
1192
+ /// specified target by default .
1193
+ fn default_cflags ( & self , target : TargetSelection , c : CLang ) -> Vec < String > {
1193
1194
if self . config . dry_run ( ) {
1194
1195
return Vec :: new ( ) ;
1195
1196
}
@@ -1198,14 +1199,18 @@ Executed at: {executed_at}"#,
1198
1199
CLang :: Cxx => self . cxx . borrow ( ) [ & target] . clone ( ) ,
1199
1200
} ;
1200
1201
1201
- // Filter out -O and /O (the optimization flags) that we picked up from
1202
- // cc-rs because the build scripts will determine that for themselves.
1203
- let mut base = base
1204
- . args ( )
1202
+ // Filter out -O and /O (the optimization flags) that we picked up
1203
+ // from cc-rs, that's up to the caller to figure out.
1204
+ base. args ( )
1205
1205
. iter ( )
1206
1206
. map ( |s| s. to_string_lossy ( ) . into_owned ( ) )
1207
1207
. filter ( |s| !s. starts_with ( "-O" ) && !s. starts_with ( "/O" ) )
1208
- . collect :: < Vec < String > > ( ) ;
1208
+ . collect :: < Vec < String > > ( )
1209
+ }
1210
+
1211
+ /// Returns extra C flags that `cc-rs` doesn't handle.
1212
+ fn extra_cflags ( & self , target : TargetSelection , which : GitRepo , c : CLang ) -> Vec < String > {
1213
+ let mut base = Vec :: new ( ) ;
1209
1214
1210
1215
// If we're compiling C++ on macOS then we add a flag indicating that
1211
1216
// we want libc++ (more filled out than libstdc++), ensuring that
0 commit comments