From 59b0a368b32e38b02044401f19f26417512de15f Mon Sep 17 00:00:00 2001 From: Steve Heindel Date: Sat, 29 Jun 2024 21:23:04 -0400 Subject: [PATCH] Change example build.rs output to avoid cluttering with cargo warnings (#73) --- freertos-rust-examples/build.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/freertos-rust-examples/build.rs b/freertos-rust-examples/build.rs index 0688c70..4d25c1c 100644 --- a/freertos-rust-examples/build.rs +++ b/freertos-rust-examples/build.rs @@ -64,16 +64,18 @@ fn main() { b.compile().unwrap_or_else(|e| panic!("{}", e)); } -/// Print relevant environment variables +/// Print relevant environment variables. +/// To avoid cluttering the output on each build, this is not displayed in the terminal. +/// See the output in the corresponding target output file e.g. target/debug/build//output fn print_env() { let env_keys = ["TARGET", "OUT_DIR", "HOST"]; env::vars().for_each(|(key, val)| { if key.starts_with("CARGO") { - println!("cargo:warning={}={}", key, val); + println!("{}={}", key, val); } else if env_keys.contains(&key.as_str()) { - println!("cargo:warning={}={}", key, val); + println!("{}={}", key, val); } else { - // println!("cargo:warning={}={}", key, val); + // println!("{}={}", key, val); } }); }