daisy/buildscript/main.rs

21 lines
579 B
Rust
Raw Normal View History

2023-06-12 15:01:44 -07:00
use std::env;
use std::path::Path;
2023-06-13 20:15:10 -07:00
mod units;
mod constants;
2023-06-12 15:01:44 -07:00
fn main() -> Result<(), ()>{
let out_dir = env::var_os("OUT_DIR").unwrap();
2023-06-12 22:56:09 -07:00
println!("cargo:rerun-if-changed=buildscript/build.rs");
2023-06-13 20:15:10 -07:00
println!("cargo:rerun-if-changed=buildscript/constants.rs");
println!("cargo:rerun-if-changed=buildscript/units.rs");
2023-06-12 22:56:09 -07:00
println!("cargo:rerun-if-changed=buildscript/units.toml");
2023-06-13 20:15:10 -07:00
println!("cargo:rerun-if-changed=buildscript/constants.toml");
2023-06-12 15:01:44 -07:00
2023-06-13 20:15:10 -07:00
units::write(&Path::new(&out_dir).join("units.rs"));
constants::write(&Path::new(&out_dir).join("constants.rs"));
2023-06-12 15:01:44 -07:00
return Ok(());
}