Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using vcpkg on any Windows target, and use find_package #509

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions curl-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
10 changes: 5 additions & 5 deletions curl-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,13 @@ fn main() {
}
}

#[cfg(not(target_env = "msvc"))]
fn try_vcpkg() -> bool {
false
}
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;
}

#[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()
.lib_names("libcurl_imp", "libcurl")
Expand Down