2017-12-09 02:50:18 +00:00
|
|
|
use std::env;
|
2017-12-30 06:17:54 +00:00
|
|
|
use std::fs;
|
|
|
|
use std::path::Path;
|
2017-12-09 02:50:18 +00:00
|
|
|
|
2017-12-08 03:40:55 +00:00
|
|
|
#[path = "../../mkmain.rs"]
|
|
|
|
mod mkmain;
|
|
|
|
|
2017-12-30 06:17:54 +00:00
|
|
|
#[cfg(target_os = "linux")]
|
2017-12-09 02:50:18 +00:00
|
|
|
mod platform {
|
2017-12-30 06:17:54 +00:00
|
|
|
pub const DYLIB_EXT: &'static str = ".so";
|
2017-12-09 02:50:18 +00:00
|
|
|
}
|
|
|
|
|
2017-12-30 06:17:54 +00:00
|
|
|
#[cfg(target_os = "macos")]
|
2017-12-09 02:50:18 +00:00
|
|
|
mod platform {
|
2017-12-30 06:17:54 +00:00
|
|
|
pub const DYLIB_EXT: &'static str = ".dylib";
|
2017-12-09 02:50:18 +00:00
|
|
|
}
|
|
|
|
|
2017-10-09 22:09:24 +00:00
|
|
|
fn main() {
|
2017-12-08 03:40:55 +00:00
|
|
|
mkmain::main();
|
|
|
|
|
2018-03-02 07:08:09 +00:00
|
|
|
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("Could not find manifest dir");
|
|
|
|
let profile = env::var("PROFILE").expect("Could not determine profile");
|
|
|
|
|
2017-12-09 02:50:18 +00:00
|
|
|
let out_dir = env::var("OUT_DIR").unwrap();
|
2018-03-12 08:20:58 +00:00
|
|
|
let libstdbuf = format!(
|
|
|
|
"{}/../../{}/{}/deps/liblibstdbuf{}",
|
|
|
|
manifest_dir,
|
|
|
|
env::var("CARGO_TARGET_DIR").unwrap_or("target".to_string()),
|
|
|
|
profile,
|
|
|
|
platform::DYLIB_EXT
|
|
|
|
);
|
|
|
|
|
2017-12-30 06:17:54 +00:00
|
|
|
fs::copy(libstdbuf, Path::new(&out_dir).join("libstdbuf.so")).unwrap();
|
2017-10-09 22:09:24 +00:00
|
|
|
}
|