|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
|
|
|
|
|
extern crate rustc_version;
|
|
|
|
|
use rustc_version::{version, version_meta, Channel};
|
|
|
|
|
use std::borrow::Cow;
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
// Assert we haven't travelled back in time
|
|
|
|
@ -25,5 +26,24 @@ fn main() {
|
|
|
|
|
// Link to GHOST and required stuffs
|
|
|
|
|
println!(r"cargo:rustc-link-search=./lib");
|
|
|
|
|
|
|
|
|
|
println!("cargo:rustc-link-lib=dylib=stdc++"); // libstdc++
|
|
|
|
|
const LINK_TO: &[&'static str] =
|
|
|
|
|
&["dylib=stdc++", //libstdc++
|
|
|
|
|
"X11", //X11
|
|
|
|
|
"OpenGL", "GL", //OpenGL
|
|
|
|
|
"GLU", "GLX", "GLEW", //GLEW
|
|
|
|
|
"spnav",
|
|
|
|
|
"Xxf86vm", "Xext",
|
|
|
|
|
"Xi", "Xrender", "Xfixes"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
for link in LINK_TO.iter().map(|x| Cow::<'static, str>::Borrowed(x))
|
|
|
|
|
.chain(std::fs::read_dir("./lib").unwrap().filter_map(|lib| lib.ok()
|
|
|
|
|
.map(|entry| entry.path().file_stem()
|
|
|
|
|
.map(|x| x.to_str()
|
|
|
|
|
.map(|x| Cow::Owned((&x[3..]).to_owned())))
|
|
|
|
|
.flatten())
|
|
|
|
|
.flatten()))
|
|
|
|
|
{
|
|
|
|
|
println!("cargo:rustc-link-lib={}", link);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|