2024-12-02 17:01:21 -05:00
|
|
|
use cc;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut build = cc::Build::new();
|
|
|
|
|
|
|
|
// HACK: cc sucks
|
|
|
|
println!("cargo:rerun-if-changed=src/rust_wrapper.cpp");
|
|
|
|
println!("cargo:rerun-if-changed=../shared/src");
|
|
|
|
|
2024-12-21 21:40:20 -05:00
|
|
|
// Build the required shared C++ bits, and the glue C++ code
|
|
|
|
// that we can import to Rust. (Since the API surface is so small,
|
|
|
|
// and not in danger of changing in a huge way, I am opting for manual
|
|
|
|
// bindings instead of using a crate like the `cxx` crate. Sue me.)
|
2024-12-02 17:01:21 -05:00
|
|
|
build
|
|
|
|
.emit_rerun_if_env_changed(true)
|
|
|
|
.cpp(true)
|
|
|
|
.std("c++20")
|
|
|
|
.include("../shared/src")
|
|
|
|
.file("../shared/src/ivshmem.cpp")
|
2024-12-21 21:40:20 -05:00
|
|
|
.file("../shared/src/client.cpp")
|
2024-12-02 17:01:21 -05:00
|
|
|
.file("src/rust_wrapper.cpp")
|
|
|
|
.compile("hazelnut_client_cpp_native");
|
|
|
|
}
|