xous-core/services/ffi-test/sys/build.rs
bunnie b8dc0a981c edge cases in cargo-fmt
so...i think in this case, maybe the build.rs wasn't formatted?
it got picked up the second time when i ran the command.

in the case of pddbkey.rs, I think the changes made by rustfmt
were so dramatic it required two passes for it to become clean.
2024-01-15 00:56:24 +08:00

24 lines
630 B
Rust

extern crate cc;
use std::env::set_var;
fn main() {
set_var("CC", "riscv64-unknown-elf-gcc"); // set the compiler to what's installed on the system
let ffi_srcs = vec!["ffi/ffi.c", "ffi/libc.c", "ffi/libc_split.c", "ffi/scanf.c"];
let ffi_includes = vec!["./"];
let mut base_config = cc::Build::new();
base_config.target("riscv32imac-unknown-none-elf");
for inc in ffi_includes {
base_config.include(inc);
}
for src in ffi_srcs {
base_config.file(src);
}
base_config.define("XOUS", None);
base_config.define("NO_STD", None);
base_config.compile("libffi.a");
}