Skip to content

Commit

Permalink
Rollup merge of #85423 - jyn514:cmake, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Don't require cmake on Windows when LLVM isn't being built

Previously, setting `download-ci-llvm = true` when cmake wasn't
installed would give the following error:

```
failed to execute command: "cmake" "--help"
error: The system cannot find the file specified. (os error 2)
```
  • Loading branch information
RalfJung authored May 18, 2021
2 parents 6e05a71 + 28c9c04 commit aef6848
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ pub fn check(build: &mut Build) {
.unwrap_or(true)
})
.any(|build_llvm_ourselves| build_llvm_ourselves);
if building_llvm || build.config.any_sanitizers_enabled() {
let need_cmake = building_llvm || build.config.any_sanitizers_enabled();
if need_cmake {
cmd_finder.must_have("cmake");
}

Expand Down Expand Up @@ -204,7 +205,7 @@ pub fn check(build: &mut Build) {
}
}

if target.contains("msvc") {
if need_cmake && target.contains("msvc") {
// There are three builds of cmake on windows: MSVC, MinGW, and
// Cygwin. The Cygwin build does not have generators for Visual
// Studio, so detect that here and error.
Expand Down

0 comments on commit aef6848

Please sign in to comment.