diff options
author | Alex Crichton <alex@alexcrichton.com> | 2018-07-02 10:20:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-02 10:20:10 -0500 |
commit | 16bfe7fbab0d9ee4ed421f7e302d9fc531efaf53 (patch) | |
tree | 4e0bb93bd5ce2e4bbac27000999c5a0abce89e35 /libssh2-sys | |
parent | 844b80094da0eb66aca7b3ff5f51c9f3ac3b5806 (diff) | |
parent | 0906727b69f357afcb0f134f0a48fc1a9e4e68bb (diff) | |
download | ssh2-rs-16bfe7fbab0d9ee4ed421f7e302d9fc531efaf53.zip |
Merge pull request #88 from Timmmm/patch-1
Add LIBSSH2_SYS_USE_PKG_CONFIG env var
Diffstat (limited to 'libssh2-sys')
-rw-r--r-- | libssh2-sys/build.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libssh2-sys/build.rs b/libssh2-sys/build.rs index b8509e8..1f5ed1a 100644 --- a/libssh2-sys/build.rs +++ b/libssh2-sys/build.rs @@ -18,11 +18,16 @@ 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()); + // The system copy of libssh2 is not used by default because it + // can lead to having two copies of libssl loaded at once. + // See https://github.com/alexcrichton/ssh2-rs/pull/88 + 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() { |