@@ -67,6 +67,7 @@ pub struct Config {
67
67
host : Option < String > ,
68
68
out_dir : Option < PathBuf > ,
69
69
profile : Option < String > ,
70
+ configure_args : Vec < OsString > ,
70
71
build_args : Vec < OsString > ,
71
72
cmake_target : Option < String > ,
72
73
env : Vec < ( OsString , OsString ) > ,
@@ -188,6 +189,7 @@ impl Config {
188
189
out_dir : None ,
189
190
target : None ,
190
191
host : None ,
192
+ configure_args : Vec :: new ( ) ,
191
193
build_args : Vec :: new ( ) ,
192
194
cmake_target : None ,
193
195
env : Vec :: new ( ) ,
@@ -318,6 +320,12 @@ impl Config {
318
320
self
319
321
}
320
322
323
+ /// Add an argument to the `cmake` configure step
324
+ pub fn configure_arg < A : AsRef < OsStr > > ( & mut self , arg : A ) -> & mut Config {
325
+ self . configure_args . push ( arg. as_ref ( ) . to_owned ( ) ) ;
326
+ self
327
+ }
328
+
321
329
/// Add an argument to the final `cmake` build step
322
330
pub fn build_arg < A : AsRef < OsStr > > ( & mut self , arg : A ) -> & mut Config {
323
331
self . build_args . push ( arg. as_ref ( ) . to_owned ( ) ) ;
@@ -727,6 +735,7 @@ impl Config {
727
735
}
728
736
729
737
if self . always_configure || !build. join ( "CMakeCache.txt" ) . exists ( ) {
738
+ cmd. args ( & self . configure_args ) ;
730
739
run ( cmd. env ( "CMAKE_PREFIX_PATH" , cmake_prefix_path) , "cmake" ) ;
731
740
} else {
732
741
println ! ( "CMake project was already configured. Skipping configuration step." ) ;
0 commit comments