From 7419be7b5d8514ca133bd30f12d7c3bc47509083 Mon Sep 17 00:00:00 2001
From: Michael Farrell <micolous+git@gmail.com>
Date: Tue, 27 Jun 2023 18:47:35 +1000
Subject: [PATCH 1/3] allow using vcpkg on non-msvc windows targets

---
 curl-sys/Cargo.toml | 4 +---
 curl-sys/build.rs   | 6 ------
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/curl-sys/Cargo.toml b/curl-sys/Cargo.toml
index 9e0a023ea..7a4b6d96c 100644
--- a/curl-sys/Cargo.toml
+++ b/curl-sys/Cargo.toml
@@ -35,12 +35,10 @@ openssl-sys = { version = "0.9.64", optional = true }
 [target.'cfg(windows)'.dependencies]
 winapi = { version = "0.3", features = ["winsock2", "ws2def"] }
 
-[target.'cfg(target_env = "msvc")'.build-dependencies]
-vcpkg = "0.2"
-
 [build-dependencies]
 pkg-config = "0.3.3"
 cc = "1.0"
+vcpkg = "0.2"
 
 [features]
 default = ["ssl"]
diff --git a/curl-sys/build.rs b/curl-sys/build.rs
index 285ab57e8..3ef94665f 100644
--- a/curl-sys/build.rs
+++ b/curl-sys/build.rs
@@ -446,12 +446,6 @@ fn main() {
     }
 }
 
-#[cfg(not(target_env = "msvc"))]
-fn try_vcpkg() -> bool {
-    false
-}
-
-#[cfg(target_env = "msvc")]
 fn try_vcpkg() -> bool {
     // the import library for the dll is called libcurl_imp
     let mut successful_probe_details = match vcpkg::Config::new()

From 83185e22ec25f5df2dfb728a1642086cd5405037 Mon Sep 17 00:00:00 2001
From: Michael Farrell <micolous+git@gmail.com>
Date: Wed, 28 Jun 2023 10:28:53 +1000
Subject: [PATCH 2/3] Use vcpkg::find_package to pull in all deps

---
 curl-sys/build.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/curl-sys/build.rs b/curl-sys/build.rs
index 3ef94665f..674fff5f0 100644
--- a/curl-sys/build.rs
+++ b/curl-sys/build.rs
@@ -447,6 +447,12 @@ fn main() {
 }
 
 fn try_vcpkg() -> bool {
+    if vcpkg::find_package("curl").is_ok() {
+        // find_package pulls in all depenedencies as needed, so there's no need
+        // for the other logic here.
+        return true;
+    }
+
     // the import library for the dll is called libcurl_imp
     let mut successful_probe_details = match vcpkg::Config::new()
         .lib_names("libcurl_imp", "libcurl")

From 88197fd7432c1a950d7ab484cffff8e63a8f52ef Mon Sep 17 00:00:00 2001
From: Michael Farrell <micolous+git@gmail.com>
Date: Wed, 28 Jun 2023 10:40:12 +1000
Subject: [PATCH 3/3] don't fail fast; because single platforms can flake

---
 .github/workflows/main.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 92eefbafe..b4a169175 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -10,6 +10,7 @@ jobs:
     name: Test
     runs-on: ${{ matrix.os }}
     strategy:
+      fail-fast: false
       matrix:
         build: [x86_64, i686, x86_64-musl, mingw, system-curl, openssl-110, x86_64-beta, x86_64-nightly, macos, win64, win32]
         include: