Skip to content

Commit bb39f35

Browse files
committed
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.
1 parent 6149dff commit bb39f35

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/bootstrap/sanity.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,16 @@ pub fn check(build: &mut Build) {
100100
if build.config.ninja {
101101
// Some Linux distros rename `ninja` to `ninja-build`.
102102
// CMake can work with either binary name.
103-
if cmd_finder.maybe_have("ninja-build").is_none() {
104-
cmd_finder.must_have("ninja");
103+
if cmd_finder.maybe_have("ninja-build").is_none()
104+
&& cmd_finder.maybe_have("ninja").is_none()
105+
{
106+
eprintln!(
107+
"
108+
Couldn't find required command: ninja
109+
You should install ninja, or set ninja=false in config.toml
110+
"
111+
);
112+
std::process::exit(1);
105113
}
106114
}
107115

0 commit comments

Comments
 (0)