@@ -67,6 +67,7 @@ pub struct Config {
6767 host : Option < String > ,
6868 out_dir : Option < PathBuf > ,
6969 profile : Option < String > ,
70+ configure_args : Vec < OsString > ,
7071 build_args : Vec < OsString > ,
7172 cmake_target : Option < String > ,
7273 env : Vec < ( OsString , OsString ) > ,
@@ -188,6 +189,7 @@ impl Config {
188189 out_dir : None ,
189190 target : None ,
190191 host : None ,
192+ configure_args : Vec :: new ( ) ,
191193 build_args : Vec :: new ( ) ,
192194 cmake_target : None ,
193195 env : Vec :: new ( ) ,
@@ -318,6 +320,12 @@ impl Config {
318320 self
319321 }
320322
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+
321329 /// Add an argument to the final `cmake` build step
322330 pub fn build_arg < A : AsRef < OsStr > > ( & mut self , arg : A ) -> & mut Config {
323331 self . build_args . push ( arg. as_ref ( ) . to_owned ( ) ) ;
@@ -727,6 +735,7 @@ impl Config {
727735 }
728736
729737 if self . always_configure || !build. join ( "CMakeCache.txt" ) . exists ( ) {
738+ cmd. args ( & self . configure_args ) ;
730739 run ( cmd. env ( "CMAKE_PREFIX_PATH" , cmake_prefix_path) , "cmake" ) ;
731740 } else {
732741 println ! ( "CMake project was already configured. Skipping configuration step." ) ;
0 commit comments