@@ -292,6 +292,13 @@ namespace vcpkg
292
292
MessageSink& status_sink,
293
293
const Path& exe_path) const = 0;
294
294
295
+ // returns true if and only if `exe_path` is a usable version of this tool, cheap check
296
+ virtual bool cheap_is_acceptable (const Path& exe_path) const
297
+ {
298
+ (void )exe_path;
299
+ return true ;
300
+ }
301
+
295
302
// returns true if and only if `exe_path` is a usable version of this tool
296
303
virtual bool is_acceptable (const Path& exe_path) const
297
304
{
@@ -344,6 +351,14 @@ namespace vcpkg
344
351
out_candidate_paths.push_back (*pf / " CMake" / " bin" / " cmake.exe" );
345
352
}
346
353
}
354
+
355
+ virtual bool cheap_is_acceptable (const Path& exe_path) const override
356
+ {
357
+ // the cmake version from mysys and cygwin can not be used because that version can't handle 'C:' in paths
358
+ auto path = exe_path.generic_u8string ();
359
+ return !Strings::ends_with (path, " /usr/bin" ) && !Strings::ends_with (path, " /cygwin64/bin" );
360
+ }
361
+
347
362
#endif
348
363
virtual ExpectedL<std::string> get_version (const ToolCache&, MessageSink&, const Path& exe_path) const override
349
364
{
@@ -765,6 +780,7 @@ namespace vcpkg
765
780
for (auto && candidate : candidates)
766
781
{
767
782
if (!fs.exists (candidate, IgnoreErrors{})) continue ;
783
+ if (!tool_provider.cheap_is_acceptable (candidate)) continue ;
768
784
auto maybe_version = tool_provider.get_version (*this , status_sink, candidate);
769
785
log_candidate (candidate, maybe_version);
770
786
const auto version = maybe_version.get ();
0 commit comments