2024-01-25 13:23:57 +00:00
|
|
|
use std::error::Error;
|
|
|
|
use std::path::PathBuf;
|
|
|
|
use std::{env, fs};
|
|
|
|
|
|
|
|
fn main() -> Result<(), Box<dyn Error>> {
|
|
|
|
let out = PathBuf::from(env::var("OUT_DIR").unwrap());
|
2024-01-26 07:58:23 +00:00
|
|
|
fs::write(out.join("memory.x"), include_bytes!("memory.x")).unwrap();
|
2024-01-25 13:23:57 +00:00
|
|
|
println!("cargo:rustc-link-search={}", out.display());
|
2024-01-26 07:58:23 +00:00
|
|
|
println!("cargo:rerun-if-changed=memory.x");
|
2024-01-25 13:23:57 +00:00
|
|
|
|
|
|
|
println!("cargo:rustc-link-arg-bins=--nmagic");
|
2024-01-26 07:58:23 +00:00
|
|
|
println!("cargo:rustc-link-arg-bins=-Tlink.x");
|
2024-01-25 13:23:57 +00:00
|
|
|
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
|
|
|
|
println!("cargo:rustc-link-arg-bins=-Tteleprobe.x");
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|