Report missing MagickWand-config in build.rs

Since build.rs requires MagickWand-config, make an effort to determine
if the executable is available or not, and panic with a clear course of
action. Otherwise the error is rather cryptic.

Fixes #3

cargo test passes
This commit is contained in:
Nathan Fiedler 2016-03-23 18:00:52 -07:00
parent 856a9e7c78
commit 3732fd5747

View file

@ -49,6 +49,10 @@ fn main() {
.current_dir("rust-bindgen")
.status().unwrap();
}
// Ensure MagickWand-config is in the PATH and report clearly if not.
if !Command::new("which").arg("MagickWand-config").status().unwrap().success() {
panic!("MagickWand-config not in the PATH, please install ImageMagick");
}
// Create the header file that rust-bindgen needs as input.
let mut gen_h = match File::create("gen.h") {
Err(why) => panic!("could not create gen.h file: {}", Error::description(&why)),