Is it possible to have a dependency in Cargo.toml, but only to force dependency to produce a loadable library, without making Rust compiler to link to that dependency?
So, I have a
cdylib dependency, say,
plugins and then a main binary, say,
main. I want cargo to make sure
plugins loadable library is always up-to-date when I run
main binary. Basically, I want
cargo run --package main to also implicitly do
cargo build --package plugins).
However, I don't want Rust to do any linking to that "plugins" (which, I think, happens if I add it to the
It seems like having dependency
cdylib might do what I want, but it produces a warning:
pluginprovides no linkable target. The compiler might raise an error while compiling
main. Consider adding 'dylib' or 'rlib' to key
plugin's Cargo.toml. This warning might turn into a hard error in the future.
which I want to avoid.
dylib type would make Rust to link to that dependency, which I don't want.