forked from M-Labs/nac3
1
0
Fork 0
nac3/nac3standalone/build.rs

22 lines
636 B
Rust
Raw Normal View History

2024-08-05 11:37:52 +08:00
use std::env;
use std::process::Command;
fn main() {
const FILE: &str = "demo/linalg/src/lib.rs";
println!("cargo:rerun-if-changed={FILE}");
let current_dir = env::current_dir().unwrap();
let linalg_dir = current_dir.join("demo").join("linalg");
env::set_current_dir(&linalg_dir).unwrap();
let output = Command::new("nix-build").current_dir(&linalg_dir).output().unwrap();
if !output.status.success() {
let stderr = String::from_utf8_lossy(&output.stderr);
eprintln!("nix-build failed: {}", stderr);
std::process::exit(1);
}
env::set_current_dir(current_dir).unwrap();
}