Skip to content

Commit

Permalink
Fix build.rs not exiting if make commands fail
Browse files Browse the repository at this point in the history
  • Loading branch information
mateiz authored and deepakn94 committed Mar 20, 2017
1 parent 386b90f commit fa270c0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions weld_rt/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::process::Command;
use std::env;
use std::process;

fn main() {
let mut path = match env::var("WELD_HOME") {
Expand All @@ -13,18 +14,24 @@ fn main() {

let cpp_path = path + &"weld_rt/cpp";

Command::new("make")
let status = Command::new("make")
.arg("clean")
.arg("-C")
.arg(cpp_path.clone())
.status()
.unwrap();
if !status.success() {
process::exit(status.code().unwrap_or(1));
}

Command::new("make")
let status = Command::new("make")
.arg("-C")
.arg(cpp_path.clone())
.status()
.unwrap();
if !status.success() {
process::exit(status.code().unwrap_or(1));
}

println!("{}", format!("cargo:rustc-link-search=native={}", cpp_path));

Expand Down

0 comments on commit fa270c0

Please sign in to comment.