19 lines
474 B
Rust
19 lines
474 B
Rust
fn add_file<'a>(build: &'a mut cc::Build, name: &'a str) -> &'a mut cc::Build {
|
|
println!("cargo:rerun-if-changed={}", name);
|
|
build.file(name)
|
|
}
|
|
|
|
fn main() {
|
|
println!("cargo:rerun-if-changed=libm/private.h");
|
|
|
|
let mut build = cc::Build::new();
|
|
|
|
build.flag("-ffreestanding").flag("-nostdlib");
|
|
|
|
add_file(&mut build, "libm/s_truncf.c");
|
|
add_file(&mut build, "libm/s_ceilf.c");
|
|
add_file(&mut build, "libm/s_floorf.c");
|
|
|
|
build.compile("m");
|
|
}
|