diff options
author | Charlie Savage <cfis@savagexi.com> | 2024-03-05 03:23:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-03-05 13:47:59 (GMT) |
commit | c2bf3e46faf8530ce176e564d779aafccaabbf7a (patch) | |
tree | 7d927e8549739d4aa9e79ed3afa9ab9fabbb13b1 | |
parent | 867550db434bfbdecd35a2714d60012932dbafe7 (diff) | |
download | CMake-c2bf3e46faf8530ce176e564d779aafccaabbf7a.zip CMake-c2bf3e46faf8530ce176e564d779aafccaabbf7a.tar.gz CMake-c2bf3e46faf8530ce176e564d779aafccaabbf7a.tar.bz2 |
FindRuby: Fix finding Ruby 3.1+ on Windows
It switched to the UCRT C runtime.
-rw-r--r-- | Modules/FindRuby.cmake | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index 029bdc2..4cc17c7 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -417,7 +417,7 @@ endif() set(_Ruby_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_Ruby_VERSION_SHORT} ruby${_Ruby_VERSION_SHORT_NODOT} ruby${_Ruby_NODOT_VERSION} ruby-${_Ruby_VERSION_SHORT} ruby-${Ruby_VERSION}) if(WIN32) - set(_Ruby_POSSIBLE_MSVC_RUNTIMES "msvcrt;vcruntime140;vcruntime140_1") + set(_Ruby_POSSIBLE_MSVC_RUNTIMES "ucrt;msvcrt;vcruntime140;vcruntime140_1") if(MSVC_TOOLSET_VERSION) list(APPEND _Ruby_POSSIBLE_MSVC_RUNTIMES "msvcr${MSVC_TOOLSET_VERSION}") else() @@ -426,16 +426,19 @@ if(WIN32) set(_Ruby_POSSIBLE_VERSION_SUFFICES "${_Ruby_NODOT_VERSION};${_Ruby_NODOT_VERSION_ZERO_PATCH}") - set(_Ruby_ARCH_PREFIX "") if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(_Ruby_ARCH_PREFIX "x64-") + set(_Ruby_POSSIBLE_ARCH_PREFIXS "libx64-;x64-") + else() + set(_Ruby_POSSIBLE_ARCH_PREFIXS "lib") endif() foreach(_Ruby_MSVC_RUNTIME ${_Ruby_POSSIBLE_MSVC_RUNTIMES}) foreach(_Ruby_VERSION_SUFFIX ${_Ruby_POSSIBLE_VERSION_SUFFICES}) - list(APPEND _Ruby_POSSIBLE_LIB_NAMES - "${_Ruby_ARCH_PREFIX}${_Ruby_MSVC_RUNTIME}-ruby${_Ruby_VERSION_SUFFIX}" - "${_Ruby_ARCH_PREFIX}${_Ruby_MSVC_RUNTIME}-ruby${_Ruby_VERSION_SUFFIX}-static") + foreach(_Ruby_ARCH_PREFIX ${_Ruby_POSSIBLE_ARCH_PREFIXS}) + list(APPEND _Ruby_POSSIBLE_LIB_NAMES + "${_Ruby_ARCH_PREFIX}${_Ruby_MSVC_RUNTIME}-ruby${_Ruby_VERSION_SUFFIX}" + "${_Ruby_ARCH_PREFIX}${_Ruby_MSVC_RUNTIME}-ruby${_Ruby_VERSION_SUFFIX}-static") + endforeach() endforeach() endforeach() endif() |