mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 09:31:34 +11:00
Switch to using a single archive
This commit is contained in:
parent
05adfabca8
commit
90b5e39b42
20
agb/build.rs
20
agb/build.rs
|
@ -11,6 +11,7 @@ fn main() {
|
|||
println!("cargo:rerun-if-changed=build.rs");
|
||||
|
||||
let out_dir = std::env::var("OUT_DIR").expect("OUT_DIR environment variable must be specified");
|
||||
let mut o_files = vec![];
|
||||
|
||||
for &a in asm.iter() {
|
||||
println!("cargo:rerun-if-changed={}", a);
|
||||
|
@ -38,12 +39,29 @@ fn main() {
|
|||
"{}",
|
||||
String::from_utf8_lossy(&out.stderr)
|
||||
);
|
||||
|
||||
for warning_line in String::from_utf8_lossy(&out.stderr).split('\n') {
|
||||
if !warning_line.is_empty() {
|
||||
println!("cargo:warning={}", warning_line);
|
||||
}
|
||||
}
|
||||
|
||||
o_files.push(out_file_path);
|
||||
}
|
||||
|
||||
println!("cargo:rustc-link-search={}", out_dir);
|
||||
let archive = format!("{out_dir}/agb.a");
|
||||
let ar_out = std::process::Command::new("arm-none-eabi-ar")
|
||||
.arg("-crs")
|
||||
.arg(&archive)
|
||||
.args(&o_files)
|
||||
.output()
|
||||
.expect("Failed to create static library");
|
||||
|
||||
assert!(
|
||||
ar_out.status.success(),
|
||||
"{}",
|
||||
String::from_utf8_lossy(&ar_out.stderr)
|
||||
);
|
||||
|
||||
println!("cargo:rustc-link-search={out_dir}");
|
||||
}
|
||||
|
|
|
@ -12,11 +12,7 @@ MEMORY {
|
|||
|
||||
__text_start = ORIGIN(rom);
|
||||
|
||||
INPUT (
|
||||
crt0.o
|
||||
interrupt_handler.o
|
||||
mixer.o
|
||||
)
|
||||
INPUT (agb.a)
|
||||
|
||||
SECTIONS {
|
||||
. = __text_start;
|
||||
|
|
Loading…
Reference in a new issue