@@ -72,6 +72,7 @@ pub struct Config {
72
72
static_crt : Option < bool > ,
73
73
uses_cxx11 : bool ,
74
74
always_configure : bool ,
75
+ no_build_target : bool ,
75
76
}
76
77
77
78
/// Builds the native library rooted at `path` with the default cmake options.
@@ -115,6 +116,7 @@ impl Config {
115
116
static_crt : None ,
116
117
uses_cxx11 : false ,
117
118
always_configure : true ,
119
+ no_build_target : false ,
118
120
}
119
121
}
120
122
@@ -167,6 +169,12 @@ impl Config {
167
169
self
168
170
}
169
171
172
+ /// Disables the target option for this compilation.
173
+ pub fn no_build_target ( & mut self , no_build_target : bool ) -> & mut Config {
174
+ self . no_build_target = no_build_target;
175
+ self
176
+ }
177
+
170
178
/// Sets the host triple for this compilation.
171
179
///
172
180
/// This is automatically scraped from `$HOST` which is set for Cargo
@@ -557,9 +565,14 @@ impl Config {
557
565
if let Some ( flags) = makeflags {
558
566
cmd. env ( "MAKEFLAGS" , flags) ;
559
567
}
560
- run ( cmd. arg ( "--build" ) . arg ( "." )
561
- . arg ( "--target" ) . arg ( target)
562
- . arg ( "--config" ) . arg ( & profile)
568
+
569
+ cmd. arg ( "--build" ) . arg ( "." ) ;
570
+
571
+ if !self . no_build_target {
572
+ cmd. arg ( "--target" ) . arg ( target) ;
573
+ }
574
+
575
+ run ( cmd. arg ( "--config" ) . arg ( & profile)
563
576
. arg ( "--" ) . args ( & self . build_args )
564
577
. args ( & parallel_args)
565
578
. current_dir ( & build) , "cmake" ) ;
0 commit comments