vpncloud/build.rs

16 lines
600 B
Rust
Raw Normal View History

2015-11-19 15:34:20 +00:00
extern crate gcc;
2015-11-30 16:27:50 +00:00
extern crate pkg_config;
2015-11-19 15:34:20 +00:00
use std::process::Command;
use std::path::Path;
2015-11-19 15:34:20 +00:00
fn main() {
if ! Path::new("libsodium/src/libsodium/.libs/libsodium.a").exists() {
Command::new("sh").arg("autogen.sh").current_dir("libsodium").status().unwrap();
Command::new("sh").arg("configure").current_dir("libsodium").status().unwrap();
Command::new("make").current_dir("libsodium").status().unwrap();
}
2015-11-21 16:06:57 +00:00
gcc::Config::new().file("src/c/tuntap.c").include("src").compile("libtuntap.a");
println!("cargo:rustc-link-search={}", "libsodium/src/libsodium/.libs");
2015-11-21 16:06:57 +00:00
}