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 Nov 26, 2022
1 parent 2178ac2 commit bf3cad9
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 @@ -62,16 +62,18 @@ fn main() {
b.compile().unwrap_or_else(|e| { panic!(e.to_string()) });
}

/// 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 bf3cad9

Please sign in to comment.