Skip to content

Commit

Permalink
Change example build.rs output to avoid cluttering with cargo warnings (
Browse files Browse the repository at this point in the history
  • Loading branch information
schteve committed Jun 30, 2024
1 parent 3a58cf9 commit 59b0a36
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions freertos-rust-examples/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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/<pkg>/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);
}
});
}

0 comments on commit 59b0a36

Please sign in to comment.