Skip to content

Commit

Permalink
Add the ssh_key_from_memory optional feature. (#331)
Browse files Browse the repository at this point in the history
* Add the ssh_key_from_memory optional feature.

* Enable the ssh_key_from_memory feature by default.

Users with older versions of libssh can still disable it if needed.
  • Loading branch information
JMLX42 authored and alexcrichton committed Jul 26, 2018
1 parent 6259a36 commit 8ca0e92
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ thread-id = "3.3.0" # remove when we work with minimal-versions without it

[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"]
1 change: 1 addition & 0 deletions libgit2-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ openssl-sys = { version = "0.9", optional = true }
ssh = ["libssh2-sys"]
https = ["openssl-sys"]
curl = ["curl-sys"]
ssh_key_from_memory = []
3 changes: 3 additions & 0 deletions libgit2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8ca0e92

Please sign in to comment.