I'm on windows and have
a Rust cdylib
[package]
name = "test1dll"
[lib]
crate-type = ["cdylib"]
and a Rust binary which depends on that dll
[package]
name = "test1"
[dependencies]
test1dll = { path = "..." }
and am looking for a way to make
cargo install
install both, the test1.exe
and test1dll.dll
, or, if it's not possible with cargo, for a not too complicated alternative.
The library needs to be a dll so i can LoadLibrary
it. A static library won't work.
I can see the binary and the dll in the target/*/deps directory but cargo install
only installs the executable.
Running cargo install
from the dll project itself gives a
error: no packages found with binaries or examples.
which matches with the documentation
This command manages Cargo's local set of installed binary crates. Only packages which have executable [[bin]] or [[example]] targets can be installed
but since it's a useful scenario to deploy a binary together with a dll on windows and Rust even offers the possibility to compile cdylib targets into dlls i'm wondering if there's a way doing this with cargo. Unfortunately i'm new to Rust and may be searching using the wrong keywords.
I thought this might come close but the runtime is explicitly excluded:
Note that cargo only supplies these dependencies when building your crate. If your program or library requires artifacts at runtime, you will still need to handle that yourself by some other means.
And either i use it wrong or cdylib-plugin also doesn't help with installing the dll.