aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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));
+ }
+}