@@ -250,6 +250,7 @@ impl Mode {
250250 }
251251}
252252
253+ #[ derive( Debug , Hash , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
253254pub enum CLang {
254255 C ,
255256 Cxx ,
@@ -1187,9 +1188,9 @@ Executed at: {executed_at}"#,
11871188 self . cc . borrow ( ) [ & target] . path ( ) . into ( )
11881189 }
11891190
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 > {
11931194 if self . config . dry_run ( ) {
11941195 return Vec :: new ( ) ;
11951196 }
@@ -1198,14 +1199,18 @@ Executed at: {executed_at}"#,
11981199 CLang :: Cxx => self . cxx . borrow ( ) [ & target] . clone ( ) ,
11991200 } ;
12001201
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 ( )
12051205 . iter ( )
12061206 . map ( |s| s. to_string_lossy ( ) . into_owned ( ) )
12071207 . 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 ( ) ;
12091214
12101215 // If we're compiling C++ on macOS then we add a flag indicating that
12111216 // we want libc++ (more filled out than libstdc++), ensuring that
0 commit comments