refactor: build.rs is more concise
This commit is contained in:
parent
368d790c63
commit
416dd1660d
1 changed files with 3 additions and 3 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue