fn main() {
let prefix =
std::env::var("FASTLANES_INSTALL_PREFIX").unwrap_or_else(|_| "../build/install".into());
let inc = format!("{}/include", &prefix);
let lib = format!("{}/lib", &prefix);
cxx_build::bridge("src/lib.rs") .include(&inc) .include(std::env::var("CARGO_MANIFEST_DIR").unwrap())
.file("bridge_shim.cpp") .flag_if_supported("-std=c++20")
.compile("fastlanes_version");
println!("cargo:rustc-link-search=native={}", lib);
println!("cargo:rustc-link-lib=static=FastLanes");
println!("cargo:rustc-link-lib=static=ALP");
println!("cargo:rustc-link-lib=static=primitives");
println!("cargo:rustc-link-lib=c++");
println!("cargo:rerun-if-env-changed=FASTLANES_INSTALL_PREFIX");
println!("cargo:rerun-if-changed=src/lib.rs");
println!("cargo:rerun-if-changed=src/bridge_shim.cpp");
}