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:
4
build.rs
4
build.rs
@ -49,6 +49,10 @@ fn main() {
|
|||||||
.current_dir("rust-bindgen")
|
.current_dir("rust-bindgen")
|
||||||
.status().unwrap();
|
.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.
|
// Create the header file that rust-bindgen needs as input.
|
||||||
let mut gen_h = match File::create("gen.h") {
|
let mut gen_h = match File::create("gen.h") {
|
||||||
Err(why) => panic!("could not create gen.h file: {}", Error::description(&why)),
|
Err(why) => panic!("could not create gen.h file: {}", Error::description(&why)),
|
||||||
|
|||||||
Reference in New Issue
Block a user