mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
utralib: use canonicalized path for svd in rebuilding
Use the full path to the .svd file to ensure it is rebuilt when the file changes. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
6041269033
commit
c36615d014
1 changed files with 5 additions and 3 deletions
|
|
@ -1,12 +1,14 @@
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let svd_file = env::var("XOUS_SVD_FILE")
|
let svd_filename = env::var("XOUS_SVD_FILE")
|
||||||
.expect("Set the environment variable `XOUS_SVD_FILE` to point to an 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=XOUS_SVD_FILE");
|
||||||
println!("cargo:rerun-if-changed={}", svd_file);
|
|
||||||
|
|
||||||
let src_file = std::fs::File::open(svd_file).expect("couldn't open src file");
|
let svd_file_path = std::path::Path::new(&svd_filename);
|
||||||
|
println!("cargo:rerun-if-changed={}", svd_file_path.canonicalize().unwrap().display());
|
||||||
|
|
||||||
|
let src_file = std::fs::File::open(svd_filename).expect("couldn't open src file");
|
||||||
let mut dest_file = std::fs::File::create("src/generated.rs").expect("couldn't open dest 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();
|
svd2utra::generate(src_file, &mut dest_file).unwrap();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue