From 0c22a51ab36f1c6b84796400a2c85dbb23b956fc Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 25 Apr 2016 23:49:19 -0400 Subject: add build script --- Cargo.toml | 3 +-- build.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 build.rs diff --git a/Cargo.toml b/Cargo.toml index 5107904..09b94f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,5 +2,4 @@ name = "vt100" version = "0.1.0" authors = ["Jesse Luehrs "] - -[dependencies] +build = "build.rs" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..14c4082 --- /dev/null +++ b/build.rs @@ -0,0 +1,12 @@ +fn main() { + 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) }); + if !out.status.success() { + println!("{}", std::string::String::from_utf8_lossy(&out.stderr)); + std::process::exit(out.status.code().unwrap_or(255)); + } +} -- cgit v1.2.3-54-g00ecf