From a8f67dacd392f733493e36bb460d52873dc2e799 Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Sun, 1 Aug 2021 18:02:52 +0100 Subject: [PATCH] error on build fail of mgba --- mgba-test-runner/build.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mgba-test-runner/build.rs b/mgba-test-runner/build.rs index 29d97b4a..d91ad4e4 100644 --- a/mgba-test-runner/build.rs +++ b/mgba-test-runner/build.rs @@ -5,12 +5,18 @@ const MGBA_VERSION: &str = "0.9.1"; fn main() { let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); let mgba_directory = out_path.join(format!("mgba-{}", MGBA_VERSION)); - std::process::Command::new("bash") + let out = std::process::Command::new("bash") .arg("build-mgba.sh") .arg(MGBA_VERSION) .arg(&out_path) .output() .expect("should be able to build mgba"); + if !out.status.success() { + panic!( + "failed to build mgba!\n{}", + String::from_utf8_lossy(&out.stderr), + ); + } println!("cargo:rustc-link-search={}", out_path.to_str().unwrap()); println!("cargo:rustc-link-lib=static={}", "mgba-cycle"); println!("cargo:rustc-link-lib=elf");