Description
Using pkgconfig
for -pc-windows-gnu
targets on non-Windows hosts is currently blocked:
rust-openssl/openssl-sys/build/find_normal.rs
Lines 201 to 209 in 8909d3e
It looks like it was originally entirely blocked on Windows in d465f6c
This was then changed to allow it for windows-gnu
from a windows
host: 43c951f#diff-b088de9b758aec6c173f92e9216ce8ce9597855d542a5d95d14b526d9259f334R140
There's probably a reason for this... but I don't know what, and this was a few years ago... so may not be needed anymore?
If the block on non-Windows hosts was removed:
if target.contains("windows-gnu") {
Then it's possible to use a vcpkg
-provided OpenSSL installation on a non-Windows host:
# the location where you checked out vcpkg to
export VCPKG_ROOT="$HOME/vcpkg"
export PKG_CONFIG_PATH_x86_64_pc_windows_gnu="$VCPKG_ROOT/installed/x64-mingw-static/lib/pkgconfig"
vcpkg install openssl:x64-mingw-static
cargo build --target x86_64-pc-windows-gnu ...
wine64 target/x86_64-pc-windows-gnu/debug/...
It may also be possible to use Linux distributions' lib*-mingw-w64
packages (example), if they packaged OpenSSL.
Separately to this, I'm trying to unblock using vcpkg-rs
on -pc-windows-gnu
targets, but that's blocked on a few other things right now.