2026-04-27 13:22:16 +02:00
|
|
|
fn main() {
|
|
|
|
|
println!("cargo:rerun-if-env-changed=LOGOS_DELIVERY_LIB_DIR");
|
|
|
|
|
|
2026-04-27 14:23:15 +02:00
|
|
|
let lib_dir = std::env::var("LOGOS_DELIVERY_LIB_DIR").expect(
|
|
|
|
|
"LOGOS_DELIVERY_LIB_DIR must be set; build liblogosdelivery via \
|
|
|
|
|
`nix build .#logos-delivery` and point this var at the result/lib directory",
|
|
|
|
|
);
|
2026-04-27 13:22:16 +02:00
|
|
|
|
|
|
|
|
println!("cargo:rustc-link-search=native={lib_dir}");
|
|
|
|
|
println!("cargo:rustc-link-lib=dylib=logosdelivery");
|
|
|
|
|
|
|
|
|
|
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
|
|
|
|
|
match target_os.as_str() {
|
2026-04-27 14:23:15 +02:00
|
|
|
"macos" | "linux" => println!("cargo:rustc-link-arg=-Wl,-rpath,{lib_dir}"),
|
2026-04-27 13:22:16 +02:00
|
|
|
other => panic!("unsupported OS for logos-delivery transport: {other}"),
|
|
|
|
|
}
|
|
|
|
|
}
|