2023-11-06 16:34:29 -08:00
|
|
|
fn main() {
|
2025-02-03 17:23:35 +00:00
|
|
|
// Find target directory, either from CARGO_TARGET_DIR or in-tree if unset.
|
|
|
|
let mut src_dir = std::env::var_os("CARGO_TARGET_DIR").unwrap_or("../../../target".into());
|
|
|
|
src_dir.push("/cxxbridge/demo/src");
|
|
|
|
|
2023-11-06 16:34:29 -08:00
|
|
|
cxx_build::bridge("src/main.rs")
|
|
|
|
.file("src/blobstore.cc")
|
|
|
|
.flag_if_supported("-std=c++14")
|
|
|
|
.include(".")
|
2025-02-03 17:23:35 +00:00
|
|
|
.include(src_dir)
|
2023-11-06 16:34:29 -08:00
|
|
|
.compile("cxxbridge-demo");
|
|
|
|
|
|
|
|
println!("cargo:rerun-if-changed=src/main.rs");
|
|
|
|
println!("cargo:rerun-if-changed=src/blobstore.cc");
|
|
|
|
println!("cargo:rerun-if-changed=include/blobstore.h");
|
|
|
|
}
|