Provide a better diagnostic if ninja isn't installed

Let people know that they can set ninja=false if they don't want to
install ninja.
This commit is contained in:
Josh Triplett 2020-07-29 13:55:34 -07:00
parent 6149dffff9
commit bb39f3555c

View File

@ -100,8 +100,16 @@ pub fn check(build: &mut Build) {
if build.config.ninja {
// Some Linux distros rename `ninja` to `ninja-build`.
// CMake can work with either binary name.
if cmd_finder.maybe_have("ninja-build").is_none() {
cmd_finder.must_have("ninja");
if cmd_finder.maybe_have("ninja-build").is_none()
&& cmd_finder.maybe_have("ninja").is_none()
{
eprintln!(
"
Couldn't find required command: ninja
You should install ninja, or set ninja=false in config.toml
"
);
std::process::exit(1);
}
}