Skip to content

Commit

Permalink
added environment variable RSIM_SILENT_DEBUG to suppress rocketsim ou…
Browse files Browse the repository at this point in the history
…tput even in debug mode (#9)
  • Loading branch information
Kaiyotech authored Dec 2, 2023
1 parent 2629323 commit 3527305
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ use glob::glob;
use miette::{IntoDiagnostic, Result};

fn main() -> Result<()> {
println!("cargo:rerun-if-env-changed=RSIM_SILENT_DEBUG");
let mut builder = Builder::new("src/lib.rs", ["RocketSim/src/", "arenar/"])
.extra_clang_args(&["-std=c++20"])
.build()?;

if !cfg!(debug_assertions) {
if cfg!(debug_assertions) && std::env::var("RSIM_SILENT_DEBUG").is_ok_and(|x| x != "0"){
builder.define("RS_DONT_LOG", "1");
}
else if !cfg!(debug_assertions) {
builder.define("RS_DONT_LOG", "1").define("RS_MAX_SPEED", "1");
}


builder
.use_plt(false)
Expand Down

0 comments on commit 3527305

Please sign in to comment.