blob: 707a8e658704ce6d764f03c87473b2466ae52486 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
extern crate "pkg-config" as pkg_config;
use std::os;
fn main() {
if pkg_config::find_library("openssl").is_err() {
let mut flags = " -l crypto -l ssl".to_string();
let target = os::getenv("TARGET").unwrap();
let win_pos = target.find_str("windows")
.or(target.find_str("win32"))
.or(target.find_str("win64"));
// It's fun, but it looks like win32 and win64 both
// have all the libs with 32 sufix
if win_pos.is_some() {
flags.push_str(" -l gdi32 -l wsock32");
}
if target.find_str("android").is_some() {
let path = os::getenv("OPENSSL_PATH").expect("Android does not provide openssl libraries, please \
build them yourselves (instructions in the README) \
and provide their location through $OPENSSL_PATH.");
flags.push_str(format!(" -L {}", path).as_slice());
}
println!("cargo:rustc-flags={}", flags);
}
}
|