libchat/crates/c-test/build.rs
osmaczko 504b743929
wip
2026-03-26 22:38:38 +01:00

18 lines
717 B
Rust

fn main() {
let manifest_dir = std::path::PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
let header_dir = manifest_dir.parent().unwrap().join("client-ffi");
// alice_bob_test.c contains both the delivery implementation (queue +
// callback) and the test logic. It has no direct references to Rust
// symbols; all protocol calls go through the ClientOps vtable supplied
// by the Rust harness.
cc::Build::new()
.file("c/alice_bob_test.c")
.include(&header_dir)
.compile("c_alice_bob");
println!("cargo:rerun-if-changed=c/alice_bob_test.c");
println!("cargo:rerun-if-changed=c/delivery.c");
println!("cargo:rerun-if-changed=build.rs");
}