summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-03-06 14:00:02 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-03-06 14:00:20 (GMT)
commite5f08e06d3b5c4b5398921e26f49de26fee7e71b (patch)
treebff8189547370415328ece48a75be10e4a1c8971 /Modules
parent1f2ac0c18ef016ff46b91989f1a6a83f44cd2375 (diff)
parentc2bf3e46faf8530ce176e564d779aafccaabbf7a (diff)
downloadCMake-e5f08e06d3b5c4b5398921e26f49de26fee7e71b.zip
CMake-e5f08e06d3b5c4b5398921e26f49de26fee7e71b.tar.gz
CMake-e5f08e06d3b5c4b5398921e26f49de26fee7e71b.tar.bz2
Merge topic 'FindRuby-3.3'
c2bf3e46fa FindRuby: Fix finding Ruby 3.1+ on Windows 867550db43 FindRuby: Add support for 3.3 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9309
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindRuby.cmake27
1 files changed, 15 insertions, 12 deletions
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 4fe8bd5..4cc17c7 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -8,7 +8,7 @@ FindRuby
Find Ruby
This module finds if Ruby is installed and determines where the
-include files and libraries are. Ruby 1.8 through 3.2 are
+include files and libraries are. Ruby 1.8 through 3.3 are
supported.
The minimum required version of Ruby can be specified using the
@@ -136,13 +136,13 @@ set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${Ruby_FIND_VERSION
# Set name of possible executables, ignoring the minor
# Eg:
-# 2.1.1 => from ruby32 to ruby21 included
-# 2.1 => from ruby32 to ruby21 included
-# 2 => from ruby32 to ruby20 included
-# empty => from ruby32 to ruby18 included
+# 2.1.1 => from ruby33 to ruby21 included
+# 2.1 => from ruby33 to ruby21 included
+# 2 => from ruby33 to ruby20 included
+# empty => from ruby33 to ruby18 included
if(NOT Ruby_FIND_VERSION_EXACT)
- foreach(_ruby_version RANGE 32 18 -1)
+ foreach(_ruby_version RANGE 33 18 -1)
string(SUBSTRING "${_ruby_version}" 0 1 _ruby_major_version)
string(SUBSTRING "${_ruby_version}" 1 1 _ruby_minor_version)
@@ -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()