Skip to content

Commit 4c09a33

Browse files
committed
Auto merge of #96659 - thatzopoulos:issue-90679-fix, r=Mark-Simulacrum
Improve error for missing cmake This PR updates the error message for a missing `cmake` to be more in line with the error message for a missing installation of `ninja`. The original issue, (#90679), suggests that both `ninja` and `cmake` are only needed for building LLVM, so I have included the suggestion from `ninja` to set `download-ci-llvm = true` if the user would rather download LLVM. If `cmake` actually is used in other areas, I can remove that part of the message. Fixes: #90679
2 parents 30046ce + bdca737 commit 4c09a33

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/bootstrap/sanity.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,18 @@ pub fn check(build: &mut Build) {
9494
.any(|build_llvm_ourselves| build_llvm_ourselves);
9595
let need_cmake = building_llvm || build.config.any_sanitizers_enabled();
9696
if need_cmake {
97-
cmd_finder.must_have("cmake");
97+
if cmd_finder.maybe_have("cmake").is_none() {
98+
eprintln!(
99+
"
100+
Couldn't find required command: cmake
101+
102+
You should install cmake, or set `download-ci-llvm = true` in the
103+
`[llvm]` section section of `config.toml` to download LLVM rather
104+
than building it.
105+
"
106+
);
107+
std::process::exit(1);
108+
}
98109
}
99110

100111
build.config.python = build

0 commit comments

Comments
 (0)