Skip to content

Commit

Permalink
Don't use non functional cmake versions
Browse files Browse the repository at this point in the history
  • Loading branch information
autoantwort committed Jan 5, 2025
1 parent 3bc9bc7 commit a1bb947
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/vcpkg/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@ namespace vcpkg
out_candidate_paths.push_back(*pf / "CMake" / "bin" / "cmake.exe");
}
}

virtual bool is_acceptable(const Path& exe_path) const override
{
// the cmake version from mysys and cygwin can not be used because that version can't handle 'C:' in paths
auto path = exe_path.generic_u8string();
return !Strings::ends_with(path, "/usr/bin") && !Strings::ends_with(path, "/cygwin64/bin");
}

#endif
virtual ExpectedL<std::string> get_version(const ToolCache&, MessageSink&, const Path& exe_path) const override
{
Expand Down Expand Up @@ -765,6 +773,7 @@ namespace vcpkg
for (auto&& candidate : candidates)
{
if (!fs.exists(candidate, IgnoreErrors{})) continue;
if (!tool_provider.is_acceptable(candidate)) continue;
auto maybe_version = tool_provider.get_version(*this, status_sink, candidate);
log_candidate(candidate, maybe_version);
const auto version = maybe_version.get();
Expand All @@ -773,7 +782,6 @@ namespace vcpkg
if (!parsed_version) continue;
auto& actual_version = *parsed_version.get();
if (!accept_version(actual_version)) continue;
if (!tool_provider.is_acceptable(candidate)) continue;

return PathAndVersion{candidate, *version};
}
Expand Down

0 comments on commit a1bb947

Please sign in to comment.