diff options
author | Jesse Luehrs <doy@tozt.net> | 2016-04-25 23:49:19 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2016-04-25 23:49:19 -0400 |
commit | 0c22a51ab36f1c6b84796400a2c85dbb23b956fc (patch) | |
tree | 42b35e1bb2e0e0eb97fd28ae207f4e9a49de76b5 | |
parent | 3ef17b959006d5fb122c1c8ea1d27e6aef222097 (diff) | |
download | vt100-rust-0c22a51ab36f1c6b84796400a2c85dbb23b956fc.tar.gz vt100-rust-0c22a51ab36f1c6b84796400a2c85dbb23b956fc.zip |
add build script
-rw-r--r-- | Cargo.toml | 3 | ||||
-rw-r--r-- | build.rs | 12 |
2 files changed, 13 insertions, 2 deletions
@@ -2,5 +2,4 @@ name = "vt100" version = "0.1.0" authors = ["Jesse Luehrs <doy@tozt.net>"] - -[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)); + } +} |