summaryrefslogtreecommitdiff
path: root/libssh2-sys
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-08-06 07:43:23 -0700
committerAlex Crichton <alex@alexcrichton.com>2018-08-06 07:46:15 -0700
commit21aa7b19410c3360db08634ddc004a27562c26aa (patch)
tree8f9e705a60cad3c0f8f6f5b076bfbf86d5ea05cf /libssh2-sys
parent3b871b6e836e96eb151a39db381df83e5f37b888 (diff)
downloadssh2-rs-21aa7b19410c3360db08634ddc004a27562c26aa.zip
Don't enable zlib compression on Windows
I don't really want to futz with pkg-config, building on all platforms is a nightmare.
Diffstat (limited to 'libssh2-sys')
-rw-r--r--libssh2-sys/build.rs12
1 files changed, 5 insertions, 7 deletions
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")