FindRuby: Improve logic populating MSVC runtime alternatives

Ruby (mswin) links to vcruntime140, but future proof by using MSVC
toolset version.
This commit is contained in:
cfis
2025-05-11 19:38:57 -07:00
committed by Brad King
parent cc4f7a73bd
commit c972050ff5

View File

@@ -398,13 +398,7 @@ set(_Ruby_POSSIBLE_LIB_NAMES
)
if (WIN32)
set(_Ruby_POSSIBLE_RUNTIMES "ucrt;msvcrt;vcruntime140;vcruntime140_1")
if (MSVC_TOOLSET_VERSION)
list(APPEND _Ruby_POSSIBLE_RUNTIMES "msvcr${MSVC_TOOLSET_VERSION}")
else ()
list(APPEND _Ruby_POSSIBLE_RUNTIMES "msvcr")
endif ()
set(_Ruby_POSSIBLE_RUNTIMES "ucrt;msvcrt;vcruntime140;vcruntime140_1;vcruntime${MSVC_TOOLSET_VERSION}")
set(_Ruby_POSSIBLE_VERSION_SUFFIXES "${_Ruby_VERSION_NODOT};${_Ruby_VERSION_NODOT_ZERO_PATCH}")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)