mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-26 09:52:39 +00:00
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.
11 lines
517 B
Rust
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();
|
|
}
|