File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -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 ) -> & mut Config {
174
+ self . no_build_target = true ;
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,8 +565,12 @@ impl Config {
557
565
if let Some ( flags) = makeflags {
558
566
cmd. env ( "MAKEFLAGS" , flags) ;
559
567
}
568
+
569
+ if !self . no_build_target {
570
+ cmd. arg ( "--target" ) . arg ( target) ;
571
+ }
572
+
560
573
run ( cmd. arg ( "--build" ) . arg ( "." )
561
- . arg ( "--target" ) . arg ( target)
562
574
. arg ( "--config" ) . arg ( & profile)
563
575
. arg ( "--" ) . args ( & self . build_args )
564
576
. args ( & parallel_args)
You can’t perform that action at this time.
0 commit comments