Don't bail out when targeting Android

This commit is contained in:
Matt Brubeck 2015-02-03 09:23:15 -08:00
parent 1a60bccb6a
commit 96a3ac2644
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() {
// Without hackory, pkg-config will only look for host libraries.
// So, abandon ship if we're cross compiling.
if !pkg_config::target_supported() { return; }
if pkg_config::find_library("openssl").is_err() {
let target = os::getenv("TARGET").unwrap(); let target = os::getenv("TARGET").unwrap();
let is_android = target.find_str("android").is_some(); let is_android = target.find_str("android").is_some();
// Without hackory, pkg-config will only look for host libraries.
// So, abandon ship if we're cross compiling.
if !is_android && !pkg_config::target_supported() {
panic!("unsupported target");
}
if pkg_config::find_library("openssl").is_err() {
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 {