summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Karpeles <magicaltux@gmail.com>2020-03-04 11:13:17 +0900
committerWez Furlong <wez@wezfurlong.org>2020-03-04 08:27:34 -0800
commit7a9b0a026b66ea05f80138ec531eeab2aeaa22f1 (patch)
tree960724fcd7b5a0e9c79df60c0d9185394426dc64
parent2e0d3cd7f9b8673b7a85195bc8dedad34fcdce62 (diff)
downloadssh2-rs-7a9b0a026b66ea05f80138ec531eeab2aeaa22f1.zip
attempt to use pkg-config to get include path for zlib and openssl if not set in env
-rw-r--r--libssh2-sys/build.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/libssh2-sys/build.rs b/libssh2-sys/build.rs
index 1a406a3..5ddc70c 100644
--- a/libssh2-sys/build.rs
+++ b/libssh2-sys/build.rs
@@ -122,6 +122,10 @@ fn main() {
cfg.define("LIBSSH2_HAVE_ZLIB", None);
if let Some(path) = env::var_os("DEP_Z_INCLUDE") {
cfg.include(path);
+ } else if let Ok(lib) = pkg_config::find_library("zlib") {
+ for path in &lib.include_paths {
+ cfg.include(path);
+ }
}
if let Some(path) = env::var_os("DEP_OPENSSL_INCLUDE") {
@@ -132,6 +136,10 @@ fn main() {
}
}
}
+ } else if let Ok(lib) = pkg_config::find_library("openssl") {
+ for path in &lib.include_paths {
+ cfg.include(path);
+ }
}
let libssh2h = fs::read_to_string("libssh2/include/libssh2.h").unwrap();