diff options
author | Tim <tdhutt@gmail.com> | 2018-06-18 11:23:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-18 11:23:47 +0100 |
commit | a35a60aafedf101dc67ff24bab2cc5817f292fb7 (patch) | |
tree | a6b7a3476d233a0454331e8e1dff3d22355c0b7d | |
parent | 9e2601d174c472a236fcf96c7247f959bf56b4d5 (diff) | |
download | ssh2-rs-a35a60aafedf101dc67ff24bab2cc5817f292fb7.zip |
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.
-rw-r--r-- | libssh2-sys/build.rs | 10 |
1 files changed, 6 insertions, 4 deletions
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() { |