xous-core/utralib/build.rs
bunnie 9a50de8b4e refactor: utra -> utralib naming
this cleans up some namespace issues when including
the utra crate which also refers to utra::generated::utra,
and there are CONST at the crate-level, and also functions
at the module-level which need disambiguation. By naming
the crate utra-lib this saves a bit of syntatic wrangling
at the top of every file.
2020-10-12 03:56:10 +08:00

11 lines
517 B
Rust

use std::env;
fn main() {
let svd_file = env::var("XOUS_SVD_FILE").expect("Set the environment variable `XOUS_SVD_FILE` to point to an SVD file");
println!("cargo:rerun-if-env-changed=XOUS_SVD_FILE");
println!("cargo:rerun-if-env-changed={}", svd_file);
let src_file = std::fs::File::open(svd_file).expect("couldn't open src file");
let mut dest_file = std::fs::File::create("src/generated.rs").expect("couldn't open dest file");
svd2utra::generate(src_file, &mut dest_file).unwrap();
}