Merge pull request #153 from mbrubeck/android

Don't bail out of openssl-sys build config when targeting Android
This commit is contained in:
Steven Fackler 2015-02-03 13:03:53 -05:00
commit 2864db42af
1 changed files with 6 additions and 5 deletions

View File

@ -5,15 +5,16 @@ extern crate "pkg-config" as pkg_config;
use std::os; use std::os;
fn main() { fn main() {
let target = os::getenv("TARGET").unwrap();
let is_android = target.find_str("android").is_some();
// Without hackory, pkg-config will only look for host libraries. // Without hackory, pkg-config will only look for host libraries.
// So, abandon ship if we're cross compiling. // So, abandon ship if we're cross compiling.
if !pkg_config::target_supported() { return; } if !is_android && !pkg_config::target_supported() {
panic!("unsupported target");
}
if pkg_config::find_library("openssl").is_err() { if pkg_config::find_library("openssl").is_err() {
let target = os::getenv("TARGET").unwrap();
let is_android = target.find_str("android").is_some();
let mut flags = if is_android { let mut flags = if is_android {
" -l crypto:static -l ssl:static" " -l crypto:static -l ssl:static"
} else { } else {