From 50a0d5b8166f927142288ba0ce5ca0bbe250923a Mon Sep 17 00:00:00 2001 From: darc Date: Wed, 17 Apr 2024 10:02:10 -0500 Subject: [PATCH] Fix passing custom CG_RUSTFLAGS when building sysroot --- build_system/src/build.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build_system/src/build.rs b/build_system/src/build.rs index 2ae325c6c00..a17adb3cd06 100644 --- a/build_system/src/build.rs +++ b/build_system/src/build.rs @@ -153,6 +153,11 @@ pub fn build_sysroot(env: &HashMap, config: &ConfigInfo) -> Resu "debug" }; + if let Ok(cg_rustflags) = std::env::var("CG_RUSTFLAGS") { + rustflags.push(' '); + rustflags.push_str(&cg_rustflags); + } + let mut env = env.clone(); env.insert("RUSTFLAGS".to_string(), rustflags); run_command_with_output_and_env(&args, Some(&start_dir), Some(&env))?;