I'm a Linux developer with very little Windows development experience, trying to upstream some changes to a Windows-only crate. The author currently has users copying .lib files into Rust's system-wide library path, then copying DLLs to the location of Cargo.toml. Since the sys library and its dependent are very small, I've set about using cc and building the sources directly.
Things seem to build, but I have to manually place DLL files in the directory alongside Cargo.toml. These DLLs are small, unlikely to be installed system-wide, shipped with the dependent library, and most consumers of the library just include them alongside their executable.
I'm wondering if, or how, build.rs should handle these DLLs? My understanding of DLLs is that they can't be statically linked into binaries. Is that so? The dependencies are shipped as both 32 and 64-bit, so I can probably copy them alongside whatever executable gets built based on the build target, but I'm wondering if that's how to go about it, or if there is a better way? I also want to ensure that they appear where they need to regardless of what type of executable is being built--main binary, an example, etc.
Thanks for any help.