Can a crate get path to target directory of the crate that depends on it
⚓ Rust 📅 2025-09-10 👤 surdeus 👁️ 10I have a crate, which needs dynamic libraries to be properly used.
The crate also provides a way to write tests and that's where the problems come in, since cargo test execution requires those dynamic libraries be specified inside PATH, which I don't want users to manually do, since for release and debug builds different dynamic libraries need to be used.
I solved this for the crate by reading CARGO_MANIFEST_DIR in a build script and copying the dlls to target/{profile}/deps, but to solve this for dependants is problematic, since I don't know where their target directories are. Are there any solutions to this?
1 post - 1 participant
🏷️ Rust_feed