Modernize cargo directives

This commit is contained in:
Steven Fackler 2015-06-28 19:41:52 -07:00
parent d465f6c5bb
commit 6e43f5c0d4
1 changed files with 5 additions and 4 deletions

View File

@ -23,7 +23,7 @@ fn main() {
} }
if let Some(mingw_paths) = get_mingw_in_path() { if let Some(mingw_paths) = get_mingw_in_path() {
for path in mingw_paths { for path in mingw_paths {
println!("cargo:rustc-flags=-L native={}", path); println!("cargo:rustc-link-search=native={}", path);
} }
} }
} }
@ -49,11 +49,12 @@ fn main() {
}; };
if let Some(lib_dir) = lib_dir { if let Some(lib_dir) = lib_dir {
println!("cargo:rustc-flags=-L native={}", lib_dir); println!("cargo:rustc-link-search=native={}", lib_dir);
} }
let libs_arg = libs.iter().fold(String::new(), |args, lib| args + &format!(" -l {0}={1}", mode, lib)); for lib in libs {
println!("cargo:rustc-flags={0}", libs_arg); println!("cargo:rustc-link-lib={}={}", mode, lib);
}
let mut include_dirs = vec![]; let mut include_dirs = vec![];