diff options
author | Jesse Luehrs <doy@tozt.net> | 2016-04-26 04:15:33 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2016-04-26 04:15:33 -0400 |
commit | 60a7ec2ecf621ebb6f3376f71b27cdc61d7fc5a1 (patch) | |
tree | ffca79a7e7a23abd070b961ed5b740779426fc6d /build.rs | |
parent | d83869a86b1832974018c51dcfac5b93e501256d (diff) | |
download | vt100-rust-60a7ec2ecf621ebb6f3376f71b27cdc61d7fc5a1.tar.gz vt100-rust-60a7ec2ecf621ebb6f3376f71b27cdc61d7fc5a1.zip |
stop tracking terminal size separately
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -1,12 +1,17 @@ +extern crate gcc; extern crate pkg_config; -fn main() { +fn libvt100() { + let dir = std::env::current_dir() + .unwrap_or_else(|e| { panic!("couldn't get cwd: {}", e) });; std::env::set_current_dir("libvt100") .unwrap_or_else(|e| { panic!("failed to chdir: {}", e) }); let out = std::process::Command::new("make") .arg("static") .output() .unwrap_or_else(|e| { panic!("failed to exec: {}", e) }); + std::env::set_current_dir(dir) + .unwrap_or_else(|e| { panic!("failed to chdir: {}", e) }); if !out.status.success() { println!("{}", std::string::String::from_utf8_lossy(&out.stderr)); std::process::exit(out.status.code().unwrap_or(255)); @@ -14,7 +19,9 @@ fn main() { println!("cargo:rustc-link-search=native=libvt100"); println!("cargo:rustc-link-lib=static=vt100"); +} +fn glib() { let lib_def = pkg_config::probe_library("glib-2.0") .unwrap_or_else(|e| { panic!("Couldn't find required dependency glib-2.0: {}", e); @@ -26,3 +33,13 @@ fn main() { println!("cargo:rustc-link-lib={}", lib); } } + +fn libvt100_wrappers() { + gcc::compile_library("libvt100wrappers.a", &["src/ffi.c"]); +} + +fn main() { + libvt100(); + glib(); + libvt100_wrappers(); +} |