esp-hal/esp32c6-lp-hal/build.rs
2023-10-05 09:00:00 -07:00

16 lines
514 B
Rust

use std::{env, error::Error, fs, path::PathBuf};
fn main() -> Result<(), Box<dyn Error>> {
// Put the linker script somewhere the linker can find it
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
println!("cargo:rustc-link-search={}", out.display());
fs::copy("ld/link.x", out.join("link.x"))?;
// Only re-run the build script when memory.x is changed,
// instead of when any part of the source code changes.
println!("cargo:rerun-if-changed=ld/memory.x");
Ok(())
}