File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -438,6 +438,14 @@ impl Config {
438438 } ;
439439 let host = self . host . clone ( ) . unwrap_or_else ( || getenv_unwrap ( "HOST" ) ) ;
440440
441+ // Some decisions later on are made if CMAKE_TOOLCHAIN_FILE is defined,
442+ // so we need to read it from the environment variables from the beginning.
443+ if !self . defined ( "CMAKE_TOOLCHAIN_FILE" ) {
444+ if let Some ( s) = self . getenv_target_os ( "CMAKE_TOOLCHAIN_FILE" ) {
445+ self . define ( "CMAKE_TOOLCHAIN_FILE" , s) ;
446+ }
447+ }
448+
441449 let generator = self
442450 . generator
443451 . clone ( )
@@ -763,14 +771,6 @@ impl Config {
763771 cmd. arg ( "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON" ) ;
764772 }
765773
766- if !self . defined ( "CMAKE_TOOLCHAIN_FILE" ) {
767- if let Some ( s) = self . getenv_target_os ( "CMAKE_TOOLCHAIN_FILE" ) {
768- let mut cmake_toolchain_file = OsString :: from ( "-DCMAKE_TOOLCHAIN_FILE=" ) ;
769- cmake_toolchain_file. push ( & s) ;
770- cmd. arg ( cmake_toolchain_file) ;
771- }
772- }
773-
774774 for & ( ref k, ref v) in c_compiler. env ( ) . iter ( ) . chain ( & self . env ) {
775775 cmd. env ( k, v) ;
776776 }
You can’t perform that action at this time.
0 commit comments