Link openssl dynamically

pull/9/head
Thijs Cadier 9 years ago
parent ddd01a78e4
commit 0d888c46cd

@ -7,8 +7,5 @@ authors = ["Thijs Cadier <thijs@appsignal.com>"]
[dependencies] [dependencies]
libc = "*" libc = "*"
[build-dependencies]
pkg-config = "*"
[build-dependencies.bindgen] [build-dependencies.bindgen]
git = "https://github.com/crabtw/rust-bindgen.git" git = "https://github.com/crabtw/rust-bindgen.git"

@ -1,7 +1,6 @@
#![feature(path_ext)] #![feature(path_ext)]
extern crate bindgen; extern crate bindgen;
extern crate pkg_config;
use std::env; use std::env;
use std::fs::PathExt; use std::fs::PathExt;
@ -115,7 +114,8 @@ fn main() {
println!("cargo:rustc-link-lib=static=bson-1.0"); println!("cargo:rustc-link-lib=static=bson-1.0");
println!("cargo:rustc-link-lib=static=mongoc-1.0"); println!("cargo:rustc-link-lib=static=mongoc-1.0");
for link_path in pkg_config::find_library("openssl").unwrap().link_paths.iter(){ // Link openssl dynamically
println!("cargo:rustc-link-search=framework={}", &link_path.display()); // TODO see if we can make this compatible with openssl-sys
} println!("cargo:rustc-link-lib=dylib=ssl");
println!("cargo:rustc-link-lib=dylib=crypto");
} }

Loading…
Cancel
Save