Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to use pkg-config to get include path for dependencies if not provided in env #525

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions libgit2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ fn main() {
if ssh {
if let Some(path) = env::var_os("DEP_SSH2_INCLUDE") {
cfg.include(path);
} else if let Ok(lib) = pkg_config::find_library("libssh2") {
for path in &lib.include_paths {
cfg.include(path);
}
}
features.push_str("#define GIT_SSH 1\n");
features.push_str("#define GIT_SSH_MEMORY_CREDENTIALS 1\n");
Expand All @@ -138,6 +142,10 @@ fn main() {
features.push_str("#define GIT_OPENSSL 1\n");
if let Some(path) = env::var_os("DEP_OPENSSL_INCLUDE") {
cfg.include(path);
} else if let Ok(lib) = pkg_config::find_library("openssl") {
for path in &lib.include_paths {
cfg.include(path);
}
}
}
}
Expand All @@ -153,6 +161,10 @@ fn main() {

if let Some(path) = env::var_os("DEP_Z_INCLUDE") {
cfg.include(path);
} else if let Ok(lib) = pkg_config::find_library("zlib") {
for path in &lib.include_paths {
cfg.include(path);
}
}

if target.contains("apple") {
Expand Down