aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-04-25 23:49:19 -0400
committerJesse Luehrs <doy@tozt.net>2016-04-25 23:49:19 -0400
commit0c22a51ab36f1c6b84796400a2c85dbb23b956fc (patch)
tree42b35e1bb2e0e0eb97fd28ae207f4e9a49de76b5
parent3ef17b959006d5fb122c1c8ea1d27e6aef222097 (diff)
downloadvt100-rust-0c22a51ab36f1c6b84796400a2c85dbb23b956fc.tar.gz
vt100-rust-0c22a51ab36f1c6b84796400a2c85dbb23b956fc.zip
add build script
-rw-r--r--Cargo.toml3
-rw-r--r--build.rs12
2 files changed, 13 insertions, 2 deletions
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 <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));
+ }
+}