File tree 1 file changed +8
-6
lines changed
cargo/cargo_build_script_runner 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,15 @@ fn run_buildrs() -> Result<(), String> {
88
88
}
89
89
}
90
90
91
- if let Some ( cc_path) = env:: var_os ( "CC" ) {
92
- let mut cc_path = exec_root. join ( cc_path) ;
93
- if let Some ( sysroot_path) = env:: var_os ( "SYSROOT" ) {
94
- cc_path. push ( " --sysroot=" ) ;
95
- cc_path. push ( & exec_root. join ( sysroot_path) ) ;
91
+ for compiler_env_var in & [ "CC" , "CXX" ] {
92
+ if let Some ( compiler_path) = env:: var_os ( compiler_env_var) {
93
+ let mut compiler_path = exec_root. join ( compiler_path) ;
94
+ if let Some ( sysroot_path) = env:: var_os ( "SYSROOT" ) {
95
+ compiler_path. push ( " --sysroot=" ) ;
96
+ compiler_path. push ( & exec_root. join ( sysroot_path) ) ;
97
+ }
98
+ command. env ( compiler_env_var, compiler_path) ;
96
99
}
97
- command. env ( "CC" , cc_path) ;
98
100
}
99
101
100
102
if let Some ( ar_path) = env:: var_os ( "AR" ) {
You can’t perform that action at this time.
0 commit comments