Hi @alexcrichton, and many thks for your work 😀.
I am having the same need as @ian-p-cooke had 4 years ago 👉 https://github.com/alexcrichton/curl-rust/issues/221.
I decided to use mingw64 to build curl-4.dll on Windows instead of vcpkg. It works as expected following these steps:
installing msys2
installing base-devel and mingw-w64-x86_64-toolchain
building curl 7.87 schannel from source for mingw64
Then I build my rust app with crate-sys dependency with these prerequisites:
adding mingw64/bin dir to path
rust toolchain stable-gnu
I expected curl-sys to link my mingw64/curl-4.dll, but it does not permit the use of mingw64's pkg_config. Instead, the crate uses embedded curl 7.86-DEV as mentioned in documentation.
So, to achieve my goal, I had to update curl-sys/build.rs line 38 like this:
if windows {
if try_vcpkg() {
return;
} else if try_pkg_config() {
return;
}
} else if try_pkg_config() {
return;
}
}
With this update, curl-sys correctly links my rust app with my fresh mingw64/curl-4.dll.
Now that compiling curl with mingw64 is working easily, I think that we could allow curl-sys to use pkg_config instead of vcpkg according to the dev's choice.
Hi @alexcrichton, and many thks for your work 😀.
I am having the same need as @ian-p-cooke had 4 years ago 👉 https://github.com/alexcrichton/curl-rust/issues/221. I decided to use
mingw64
to buildcurl-4.dll
on Windows instead ofvcpkg
. It works as expected following these steps:Then I build my rust app with
crate-sys
dependency with these prerequisites:I expected
curl-sys
to link mymingw64/curl-4.dll
, but it does not permit the use of mingw64'spkg_config
. Instead, the crate uses embeddedcurl 7.86-DEV
as mentioned in documentation.So, to achieve my goal, I had to update
curl-sys/build.rs
line38
like this:With this update,
curl-sys
correctly links my rust app with my freshmingw64/curl-4.dll
.Now that compiling curl with mingw64 is working easily, I think that we could allow
curl-sys
to usepkg_config
instead ofvcpkg
according to the dev's choice.