Fix passing custom CG_RUSTFLAGS when building sysroot

This commit is contained in:
darc 2024-04-17 10:02:10 -05:00
parent 56a022f5e5
commit 50a0d5b816

View File

@ -153,6 +153,11 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu
"debug" "debug"
}; };
if let Ok(cg_rustflags) = std::env::var("CG_RUSTFLAGS") {
rustflags.push(' ');
rustflags.push_str(&cg_rustflags);
}
let mut env = env.clone(); let mut env = env.clone();
env.insert("RUSTFLAGS".to_string(), rustflags); env.insert("RUSTFLAGS".to_string(), rustflags);
run_command_with_output_and_env(&args, Some(&start_dir), Some(&env))?; run_command_with_output_and_env(&args, Some(&start_dir), Some(&env))?;