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 {
438
438
} ;
439
439
let host = self . host . clone ( ) . unwrap_or_else ( || getenv_unwrap ( "HOST" ) ) ;
440
440
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
+
441
449
let generator = self
442
450
. generator
443
451
. clone ( )
@@ -763,14 +771,6 @@ impl Config {
763
771
cmd. arg ( "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON" ) ;
764
772
}
765
773
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
-
774
774
for & ( ref k, ref v) in c_compiler. env ( ) . iter ( ) . chain ( & self . env ) {
775
775
cmd. env ( k, v) ;
776
776
}
You can’t perform that action at this time.
0 commit comments