diff --git a/Cargo.toml b/Cargo.toml index 981a997072..447468670e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,10 +40,11 @@ tempdir = "0.3" [features] unstable = [] -default = ["ssh", "https", "curl"] +default = ["ssh", "https", "curl", "ssh_key_from_memory"] ssh = ["libgit2-sys/ssh"] https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"] curl = ["libgit2-sys/curl"] +ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"] [workspace] members = ["systest", "git2-curl"] diff --git a/libgit2-sys/Cargo.toml b/libgit2-sys/Cargo.toml index 67e643aa62..54ed78076f 100644 --- a/libgit2-sys/Cargo.toml +++ b/libgit2-sys/Cargo.toml @@ -33,3 +33,4 @@ openssl-sys = { version = "0.9", optional = true } ssh = ["libssh2-sys"] https = ["openssl-sys"] curl = ["curl-sys"] +ssh_key_from_memory = [] diff --git a/libgit2-sys/build.rs b/libgit2-sys/build.rs index 1e92dbcdc6..b765ece455 100644 --- a/libgit2-sys/build.rs +++ b/libgit2-sys/build.rs @@ -48,6 +48,9 @@ fn main() { let msvc = target.contains("msvc"); let mut cfg = cmake::Config::new("libgit2"); + #[cfg(feature = "ssh_key_from_memory")] + cfg.define("GIT_SSH_MEMORY_CREDENTIALS", "1"); + if msvc { // libgit2 passes the /GL flag to enable whole program optimization, but // this requires that the /LTCG flag is passed to the linker later on,