summaryrefslogtreecommitdiff
path: root/libssh2-sys/build.rs
diff options
context:
space:
mode:
authorTim <tdhutt@gmail.com>2018-06-18 11:23:47 +0100
committerGitHub <noreply@github.com>2018-06-18 11:23:47 +0100
commita35a60aafedf101dc67ff24bab2cc5817f292fb7 (patch)
treea6b7a3476d233a0454331e8e1dff3d22355c0b7d /libssh2-sys/build.rs
parent9e2601d174c472a236fcf96c7247f959bf56b4d5 (diff)
downloadssh2-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.
Diffstat (limited to 'libssh2-sys/build.rs')
-rw-r--r--libssh2-sys/build.rs10
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() {