From a35a60aafedf101dc67ff24bab2cc5817f292fb7 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 18 Jun 2018 11:23:47 +0100 Subject: Add LIBSSH2_SYS_USE_PKG_CONFIG env var The latest actual release of libssh2 is old and broken. This uses the submodule instead unless you set `LIBSSH2_SYS_USE_PKG_CONFIG`. The mechanism is copied from libgit2. --- libssh2-sys/build.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libssh2-sys') diff --git a/libssh2-sys/build.rs b/libssh2-sys/build.rs index b8509e8..df9a0f2 100644 --- a/libssh2-sys/build.rs +++ b/libssh2-sys/build.rs @@ -18,11 +18,13 @@ fn main() { register_dep("Z"); register_dep("OPENSSL"); - if let Ok(lib) = pkg_config::find_library("libssh2") { - for path in &lib.include_paths { - println!("cargo:include={}", path.display()); + if env::var("LIBSSH2_SYS_USE_PKG_CONFIG").is_ok() { + if let Ok(lib) = pkg_config::find_library("libssh2") { + for path in &lib.include_paths { + println!("cargo:include={}", path.display()); + } + return } - return } if !Path::new("libssh2/.git").exists() { -- cgit v1.2.3