A build dependency for building zig
libraries.
Please look at test-crate for a full example.
// build.rs
fn main() {
println!("cargo:rerun-if-changed=libhello/build.zig");
println!("cargo:rerun-if-changed=libsl/hello.zig");
let dst = zig::build("libhello");
println!("cargo:rustc-link-search=native={}", dst.display());
println!("cargo:rustc-link-lib=static=hello");
}
- Based on cmake-rs for zig, but way more minimal at the moment (I don't know zig...).
- Skimmed zig build system for how to build a library.