utralib: fix build dependency on svd file

Previously, the svd file was treated as an environment variable to
watch. Naturally this never changed, so an updated svd file never
triggered a rebuild.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-10-13 08:32:39 +08:00
parent 5e4c702c02
commit bb0db65e58

View file

@ -1,9 +1,10 @@
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");
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);
println!("cargo:rerun-if-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");