From c5ac21e0efd33dd3ddbba6b629e1de89e825d3d7 Mon Sep 17 00:00:00 2001 From: Michael Farrell Date: Tue, 27 Jun 2023 18:10:31 +1000 Subject: [PATCH 1/2] Use vcpkg for all Windows targets --- Cargo.toml | 2 -- build.rs | 8 +------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 71932506..34b28d19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,8 +34,6 @@ libc = { version = "0.2.43", optional = true } pkg-config = "0.3.9" cc = "1.0.18" cmake = { version = "0.1.44", optional = true } - -[target.'cfg(target_env = "msvc")'.build-dependencies] vcpkg = "0.2" [features] diff --git a/build.rs b/build.rs index ca8860ad..475a8530 100644 --- a/build.rs +++ b/build.rs @@ -42,7 +42,7 @@ fn main() { } } - if target.contains("msvc") { + if target.contains("windows") { if try_vcpkg() { return; } @@ -158,12 +158,6 @@ mod build_zng; #[cfg(feature = "zlib-ng")] use build_zng::build_zlib_ng; -#[cfg(not(target_env = "msvc"))] -fn try_vcpkg() -> bool { - false -} - -#[cfg(target_env = "msvc")] fn try_vcpkg() -> bool { // see if there is a vcpkg tree with zlib installed match vcpkg::Config::new() From 6c235db38b82dfc518d7af2e1bdceae1f39741fe Mon Sep 17 00:00:00 2001 From: Michael Farrell Date: Wed, 28 Jun 2023 10:33:35 +1000 Subject: [PATCH 2/2] use vcpkg::find_package --- build.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 475a8530..51ebe6bf 100644 --- a/build.rs +++ b/build.rs @@ -162,8 +162,7 @@ fn try_vcpkg() -> bool { // see if there is a vcpkg tree with zlib installed match vcpkg::Config::new() .emit_includes(true) - .lib_names("zlib", "zlib1") - .probe("zlib") + .find_package("zlib") { Ok(_) => true, Err(e) => {