@@ -120,8 +120,10 @@ fn run(config: &cargo::Config, matches: &getopts::Matches, explain: bool) -> Res
120
120
( work_info, stable_crate. max_version . clone ( ) )
121
121
} ;
122
122
123
- let ( current_rlib, current_deps_output) = current. rlib_and_dep_output ( config, & name, true ) ?;
124
- let ( stable_rlib, stable_deps_output) = stable. rlib_and_dep_output ( config, & name, false ) ?;
123
+ let ( current_rlib, current_deps_output) =
124
+ current. rlib_and_dep_output ( config, & name, true , matches) ?;
125
+ let ( stable_rlib, stable_deps_output) =
126
+ stable. rlib_and_dep_output ( config, & name, false , matches) ?;
125
127
126
128
println ! ( "current_rlib: {:?}" , current_rlib) ;
127
129
println ! ( "stable_rlib: {:?}" , stable_rlib) ;
@@ -385,11 +387,17 @@ impl<'a> WorkInfo<'a> {
385
387
config : & ' a cargo:: Config ,
386
388
name : & str ,
387
389
current : bool ,
390
+ matches : & getopts:: Matches ,
388
391
) -> Result < ( PathBuf , PathBuf ) > {
389
392
let mut opts =
390
393
cargo:: ops:: CompileOptions :: new ( config, cargo:: core:: compiler:: CompileMode :: Build ) ?;
391
394
// we need the build plan to find our build artifacts
392
395
opts. build_config . build_plan = true ;
396
+
397
+ if let Some ( target) = matches. opt_str ( "target" ) {
398
+ opts. build_config . requested_target = Some ( target) ;
399
+ }
400
+
393
401
// TODO: this is where we could insert feature flag builds (or using the CLI mechanisms)
394
402
395
403
env:: set_var (
@@ -421,8 +429,10 @@ impl<'a> WorkInfo<'a> {
421
429
if i. package_name == name {
422
430
// FIXME: this is a hack to avoid picking up output artifacts of
423
431
// build scrits and build programs (no outputs):
424
- let build_script =
425
- i. outputs . iter ( ) . any ( |v| v. to_str ( ) . unwrap ( ) . contains ( "build_script" ) ) ;
432
+ let build_script = i
433
+ . outputs
434
+ . iter ( )
435
+ . any ( |v| v. to_str ( ) . unwrap ( ) . contains ( "build_script" ) ) ;
426
436
let build_program = i. outputs . is_empty ( ) ;
427
437
if build_script || build_program {
428
438
continue ;
0 commit comments