Skip to content

Commit

Permalink
Merge pull request #136 from micolous/vcpkg
Browse files Browse the repository at this point in the history
Allow using vcpkg for all Windows targets, and use find_package
  • Loading branch information
Byron authored Jul 23, 2023
2 parents 0b1d46e + 6c235db commit 708f738
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 2 additions & 9 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn main() {
}
}

if target.contains("msvc") {
if target.contains("windows") {
if try_vcpkg() {
return;
}
Expand Down Expand Up @@ -158,18 +158,11 @@ 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()
.emit_includes(true)
.lib_names("zlib", "zlib1")
.probe("zlib")
.find_package("zlib")
{
Ok(_) => true,
Err(e) => {
Expand Down

0 comments on commit 708f738

Please sign in to comment.