2021-02-21 05:49:40 +11:00
|
|
|
fn main() {
|
2021-11-22 07:04:45 +11:00
|
|
|
// we skip assembling the runtime for docs.rs builds.
|
|
|
|
if !cfg!(docs_rs) {
|
2021-02-21 05:49:40 +11:00
|
|
|
let out_file = "rsrt0.o";
|
|
|
|
let out_dir = std::env::var("OUT_DIR").unwrap();
|
|
|
|
let out_dir_file = format!("{}/{}", out_dir, out_file);
|
|
|
|
let as_output = std::process::Command::new("arm-none-eabi-as")
|
2021-11-22 07:04:45 +11:00
|
|
|
.args(&["-o", out_dir_file.as_str()])
|
|
|
|
.arg("-mthumb-interwork")
|
|
|
|
.arg("-mcpu=arm7tdmi")
|
|
|
|
.arg("src/rsrt0.S")
|
|
|
|
.output()
|
|
|
|
.expect("failed to run arm-none-eabi-as");
|
2021-02-21 05:49:40 +11:00
|
|
|
if !as_output.status.success() {
|
2021-11-22 07:04:45 +11:00
|
|
|
panic!("{}", String::from_utf8_lossy(&as_output.stderr));
|
2021-02-21 05:49:40 +11:00
|
|
|
}
|
|
|
|
//
|
|
|
|
println!("cargo:rustc-link-search={}", out_dir);
|
2021-11-22 07:04:45 +11:00
|
|
|
}
|
|
|
|
}
|