I am using Rust in a Meson based build-system where I build a static library that I need to link to a Rust crate built with Cargo. Right-now I use this environment variable in my Cargo invocation:
'CARGO_ENCODED_RUSTFLAGS': '-lnative='+my_static_lib.full_path(),
However Cargo complain that it cannot find the static library.
When I attempt a dirty hack by using -L to add a search directory and -l with only the library name Cargo don't find the library because it adds platform specific prefix/suffix.
I saw that Rust #[link] attribute have a +verbatim modifier that may have some potential but it expect the name of the library and does not accept env!() macros right-now.
I want a clean way to link the Rust program to the static library. How ?