From 416dd1660da77857334fb8ab4635cd668545b66a Mon Sep 17 00:00:00 2001 From: cscherr Date: Thu, 31 Jul 2025 16:21:25 +0200 Subject: [PATCH] refactor: build.rs is more concise --- crates/algorithms/build.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/algorithms/build.rs b/crates/algorithms/build.rs index 2f02505..6a648c8 100755 --- a/crates/algorithms/build.rs +++ b/crates/algorithms/build.rs @@ -30,17 +30,16 @@ fn main() { let mut cmd = std::process::Command::new("ceedling.bat"); #[cfg(not(target_os = "windows"))] let mut cmd = std::process::Command::new("ceedling"); - cmd.arg("release"); let arch = env("CARGO_CFG_TARGET_ARCH"); let pw = env("CARGO_CFG_TARGET_POINTER_WIDTH"); let os = env("CARGO_CFG_TARGET_OS"); - if arch == "arm" && pw == "32" && os == "none" && !cfg!(test) { + if arch == "arm" && pw == "32" && os == "none" { cmd.env("CC", "arm-none-eabi-gcc") .env("AR", "arm-none-eabi-ar") .env("CC_FLAGS", "-march=armv6-m"); - } else if os == "linux" || os == "windows" || cfg!(test) { + } else if os == "linux" || os == "windows" { cmd.env("CC", "gcc").env("AR", "ar"); } else { panic!("Unsupported build target") @@ -48,6 +47,7 @@ fn main() { println!("Cwd: {}", std::env::current_dir().unwrap().display()); let status = cmd + .arg("release") .current_dir("./algorithms-c") .status() .expect("could not make c stuff");