I found this issue about usage of shared libraries for cargo test
and cargo run
.
Also I found that it is possible to set environment variable during build via:
println!("rustc-env=LD_LIBRARY_PATH=3rdparty/libs");
But looks like these environment variables was used only during cargo build
,
not cargo test
.
Is any work around, may be set rpath for tests somehow?
I use only Linux, so any linux specific aswers are fine.
Also I don't want to add env variable to .bashrc
, because of I need to add CI script,
also configure all developers machines. So I am looking some solution to fix it inside code base.
Note: I have no problems with cargo build
, I used println!(rustc-link-search
for it.