diff options
author | Josh Triplett <josh@joshtriplett.org> | 2020-08-18 15:55:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-18 17:55:14 -0500 |
commit | d2ef03fe63ba44b0a64e2469ca20c99d6e4ed71d (patch) | |
tree | 34983ee3033fc7c7f243ff1ce78cb340e58bcf8a /libssh2-sys/build.rs | |
parent | 5fe0a8cd26aa001209e1fbc99e1ecc48a9b18d61 (diff) | |
download | ssh2-rs-d2ef03fe63ba44b0a64e2469ca20c99d6e4ed71d.zip |
libssh2-sys: Add support for zlib-ng (#197)
Update to libz-sys 1.1.0, which supports zlib-ng. Provide a feature
zlib-ng-compat to allow building with zlib-ng. Since doing so statically
links zlib-ng, ensure that this feature prevents using a system libssh2.
Diffstat (limited to 'libssh2-sys/build.rs')
-rw-r--r-- | libssh2-sys/build.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libssh2-sys/build.rs b/libssh2-sys/build.rs index e63ed0a..2150148 100644 --- a/libssh2-sys/build.rs +++ b/libssh2-sys/build.rs @@ -10,7 +10,9 @@ use std::path::{Path, PathBuf}; use std::process::Command; fn main() { - if try_vcpkg() { + let zlib_ng_compat = env::var("CARGO_FEATURE_ZLIB_NG_COMPAT").is_ok(); + + if !zlib_ng_compat && try_vcpkg() { return; } @@ -19,6 +21,9 @@ fn main() { // See https://github.com/alexcrichton/ssh2-rs/pull/88 println!("cargo:rerun-if-env-changed=LIBSSH2_SYS_USE_PKG_CONFIG"); if env::var("LIBSSH2_SYS_USE_PKG_CONFIG").is_ok() { + if zlib_ng_compat { + panic!("LIBSSH2_SYS_USE_PKG_CONFIG set, but cannot use zlib-ng-compat with system libssh2"); + } if let Ok(lib) = pkg_config::find_library("libssh2") { for path in &lib.include_paths { println!("cargo:include={}", path.display()); |