Created
November 29, 2014 02:25
-
-
Save pmsanford/87519ed32adbeca72595 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::os; | |
use std::io::fs; | |
use std::io::fs::PathExtensions; | |
const LIB_PATH_REL: &'static str = "../libs/libtcod"; | |
fn main() { | |
let out_dir = os::getenv("OUT_DIR").unwrap(); | |
let dst = Path::new(out_dir.clone()); | |
let src = Path::new(LIB_PATH_REL); | |
println!("cargo:rustc-flags=-l tcod:dylib -L {}", out_dir); | |
let files = fs::readdir(&src).unwrap(); | |
for entry in files.iter() { | |
if entry.is_file() && | |
entry.filename().unwrap().ends_with("dylib".as_bytes()) { | |
let dst_file = dst.join(entry.filename().unwrap()); | |
match fs::copy(entry, &dst_file) { | |
Err(why) => panic!(why), | |
Ok(_) => {} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment