summaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
authorNathan Lee <me@nwlee.tech>2026-06-23 21:54:22 -0500
committerNathan Lee <me@nwlee.tech>2026-06-23 21:54:22 -0500
commitc493f0997d1cb107667e516c5d6ef00443922f5c (patch)
tree8a059b218c7b9348470e4e6a64573e5969d19549 /build.rs
parent3ba80868b455858082cae0c4e902d27ce24d97ed (diff)
move dts source into the emulator directory
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs26
1 files changed, 26 insertions, 0 deletions
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