aboutsummaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-04-26 02:40:23 -0400
committerJesse Luehrs <doy@tozt.net>2016-04-26 02:40:23 -0400
commit88e064a448756bb4a9045a9260702f60ba492990 (patch)
tree88edf10c96d95dc3eb83f7a3f3d0dfc57ab27f83 /build.rs
parent0c22a51ab36f1c6b84796400a2c85dbb23b956fc (diff)
downloadvt100-rust-88e064a448756bb4a9045a9260702f60ba492990.tar.gz
vt100-rust-88e064a448756bb4a9045a9260702f60ba492990.zip
get ffi framework in place
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/build.rs b/build.rs
index 14c4082..e5bb100 100644
--- a/build.rs
+++ b/build.rs
@@ -1,3 +1,5 @@
+extern crate pkg_config;
+
fn main() {
std::env::set_current_dir("libvt100")
.unwrap_or_else(|e| { panic!("failed to chdir: {}", e) });
@@ -9,4 +11,18 @@ fn main() {
println!("{}", std::string::String::from_utf8_lossy(&out.stderr));
std::process::exit(out.status.code().unwrap_or(255));
}
+
+ println!("cargo:rustc-link-search=native=libvt100");
+ println!("cargo:rustc-link-lib=static=vt100");
+
+ let lib_def = pkg_config::probe_library("glib-2.0")
+ .unwrap_or_else(|e| {
+ panic!("Couldn't find required dependency glib-2.0: {}", e);
+ });
+ for dir in lib_def.link_paths {
+ println!("cargo:rustc-link-search=native={:?}", dir);
+ }
+ for lib in lib_def.libs {
+ println!("cargo:rustc-link-lib={}", lib);
+ }
}