From 21aa7b19410c3360db08634ddc004a27562c26aa Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 6 Aug 2018 07:43:23 -0700 Subject: Don't enable zlib compression on Windows I don't really want to futz with pkg-config, building on all platforms is a nightmare. --- libssh2-sys/build.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'libssh2-sys') diff --git a/libssh2-sys/build.rs b/libssh2-sys/build.rs index 1f5ed1a..f0df6ad 100644 --- a/libssh2-sys/build.rs +++ b/libssh2-sys/build.rs @@ -49,12 +49,11 @@ fn main() { // If libz-sys was built it'll give us an include directory to learn how to // link to it, and for MinGW targets we just pass a dummy include dir to // ensure it's detected (apparently it isn't otherwise?) - match env::var_os("DEP_Z_INCLUDE") { - Some(path) => { cfg.define("ZLIB_INCLUDE_DIR", path); } - None if target.contains("windows-gnu") => { - cfg.define("ZLIB_INCLUDE_DIR", "/"); - } - None => {} + if !target.contains("windows") && env::var_os("DEP_Z_INCLUDE").is_some() { + cfg.define("ENABLE_ZLIB_COMPRESSION", "ON") + .register_dep("Z"); + } else { + cfg.define("ENABLE_ZLIB_COMPRESSION", "OFF"); } if let Some(path) = env::var_os("DEP_OPENSSL_INCLUDE") { @@ -73,7 +72,6 @@ fn main() { } let dst = cfg.define("BUILD_SHARED_LIBS", "OFF") - .define("ENABLE_ZLIB_COMPRESSION", "ON") .define("CMAKE_INSTALL_LIBDIR", "lib") .define("BUILD_EXAMPLES", "OFF") .define("BUILD_TESTING", "OFF") -- cgit v1.2.3