From c493f0997d1cb107667e516c5d6ef00443922f5c Mon Sep 17 00:00:00 2001 From: Nathan Lee Date: Tue, 23 Jun 2026 21:54:22 -0500 Subject: move dts source into the emulator directory --- build.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 build.rs (limited to 'build.rs') diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..829bb31 --- /dev/null +++ b/build.rs @@ -0,0 +1,26 @@ +use std::process::Command; +use std::path::Path; + +fn main() { + println!("cargo:rerun-if-changed=wrv32em-common.dts"); + + let out_dir = std::env::var("OUT_DIR").unwrap(); + let output = Path::new(&out_dir).join("wrv32em-common.dtb"); + + let status = Command::new("dtc") + .args([ + "-I", "dts", + "-O", "dtb", + "-o", + output.to_str().unwrap(), + "wrv32em-common.dts", + ]) + .status() + .expect("failed to run dtc"); + + if !status.success() { + panic!("dtc failed"); + } + + println!("cargo:rustc-env=DTB_PATH={}", output.display()); +} \ No newline at end of file -- cgit v1.2.3