@@ -121,10 +121,6 @@ fn run(config: &cargo::Config, matches: &getopts::Matches) -> Result<()> {
121
121
child. args ( & [ "--target" , & target] ) ;
122
122
}
123
123
124
- if !matches. opt_present ( "no-default-features" ) {
125
- child. args ( & [ "--cfg" , "feature=\" default\" " ] ) ;
126
- }
127
-
128
124
let mut child = child
129
125
. arg ( "-" )
130
126
. stdin ( Stdio :: piped ( ) )
@@ -207,10 +203,6 @@ fn run(config: &cargo::Config, matches: &getopts::Matches) -> Result<()> {
207
203
child. args ( & [ "--target" , & target] ) ;
208
204
}
209
205
210
- if !matches. opt_present ( "no-default-features" ) {
211
- child. args ( & [ "--cfg" , "feature=\" default\" " ] ) ;
212
- }
213
-
214
206
let child = child
215
207
. arg ( "-" )
216
208
. stdin ( Stdio :: piped ( ) )
@@ -284,6 +276,17 @@ mod cli {
284
276
"api-guidelines" ,
285
277
"report only changes that are breaking according to the API-guidelines" ,
286
278
) ;
279
+ opts. optopt (
280
+ "" ,
281
+ "features" ,
282
+ "Space-separated list of features to activate" ,
283
+ "FEATURES" ,
284
+ ) ;
285
+ opts. optflag (
286
+ "" ,
287
+ "all-features" ,
288
+ "Activate all available features" ,
289
+ ) ;
287
290
opts. optflag (
288
291
"" ,
289
292
"no-default-features" ,
@@ -458,9 +461,13 @@ impl<'a> WorkInfo<'a> {
458
461
if let Some ( target) = matches. opt_str ( "target" ) {
459
462
opts. build_config . requested_target = Some ( target) ;
460
463
}
461
- opts. no_default_features = matches. opt_present ( "no-default-features" ) ;
462
464
463
- // TODO: this is where we could insert feature flag builds (or using the CLI mechanisms)
465
+ if let Some ( s) = matches. opt_str ( "features" ) {
466
+ opts. features = s. split ( " " ) . map ( str:: to_owned) . collect ( ) ;
467
+ }
468
+
469
+ opts. all_features = matches. opt_present ( "all-features" ) ;
470
+ opts. no_default_features = matches. opt_present ( "no-default-features" ) ;
464
471
465
472
env:: set_var (
466
473
"RUSTFLAGS" ,
0 commit comments