mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-27 07:01:14 +00:00
build(amm): load amm_client_ffi via absolute store-path id + DYLD fallback on macOS
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
[package]
|
||||
name = "amm_client_ffi"
|
||||
version = "0.1.0"
|
||||
# 2021 (not the repo's 2024): matches amm_core and keeps plain #[no_mangle]
|
||||
# (edition 2024 requires #[unsafe(no_mangle)]).
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
name = "amm_client_ffi"
|
||||
# The logos module builder's macOS find_library only locates SHARED libs
|
||||
# (lib<name>.dylib), never a static .a — so we must ship the cdylib. The flake
|
||||
# gives the dylib an ABSOLUTE store-path install-name (not @rpath), so the plugin
|
||||
# links it by its /nix/store path (kept in the closure) and dlopen resolves it at
|
||||
# runtime without any rpath staging. staticlib/rlib kept for other consumers/tests.
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -5,4 +5,6 @@ fn main() {
|
||||
.expect("cbindgen")
|
||||
.write_to_file(format!("{crate_dir}/amm_client_ffi.h"));
|
||||
println!("cargo:rerun-if-changed=src/lib.rs");
|
||||
println!("cargo:rerun-if-changed=src");
|
||||
println!("cargo:rerun-if-changed=cbindgen.toml");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user