summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-12 14:09:43 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-11-12 14:09:52 (GMT)
commit10c46689ecfd5cc633bba26bea96a10343277d43 (patch)
treef5f33d7e72037bdb5dcc3d62ab599c3d83376d02 /Modules
parent8705f9116e5257c52746d6e1aadd28d1c9357e00 (diff)
parentd4a16427e20d6c1e19a516d265796efe68fc42c7 (diff)
downloadCMake-10c46689ecfd5cc633bba26bea96a10343277d43.zip
CMake-10c46689ecfd5cc633bba26bea96a10343277d43.tar.gz
CMake-10c46689ecfd5cc633bba26bea96a10343277d43.tar.bz2
Merge topic 'FindRuby-vs-runtimes'
d4a16427e2 FindRuby: Consider more VS runtime suffix combinations Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5486
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindRuby.cmake20
1 files changed, 13 insertions, 7 deletions
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index a0cdf3b..d12f825 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -401,6 +401,7 @@ if(Ruby_VERSION_MAJOR)
set(_Ruby_VERSION_SHORT "${Ruby_VERSION_MAJOR}.${Ruby_VERSION_MINOR}")
set(_Ruby_VERSION_SHORT_NODOT "${Ruby_VERSION_MAJOR}${Ruby_VERSION_MINOR}")
set(_Ruby_NODOT_VERSION "${Ruby_VERSION_MAJOR}${Ruby_VERSION_MINOR}${Ruby_VERSION_PATCH}")
+ set(_Ruby_NODOT_VERSION_ZERO_PATCH "${Ruby_VERSION_MAJOR}${Ruby_VERSION_MINOR}0")
endif()
# FIXME: Currently we require both the interpreter and development components to be found
@@ -433,22 +434,27 @@ endif()
set(_Ruby_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_Ruby_VERSION_SHORT} ruby${_Ruby_VERSION_SHORT_NODOT} ruby-${_Ruby_VERSION_SHORT} ruby-${Ruby_VERSION})
if(WIN32)
+ set(_Ruby_POSSIBLE_MSVC_RUNTIMES "msvcrt;vcruntime140;vcruntime140_1")
if(MSVC_TOOLSET_VERSION)
- set(_Ruby_MSVC_RUNTIME "${MSVC_TOOLSET_VERSION}")
+ list(APPEND _Ruby_POSSIBLE_MSVC_RUNTIMES "msvcr${MSVC_TOOLSET_VERSION}")
else()
- set(_Ruby_MSVC_RUNTIME "")
+ list(APPEND _Ruby_POSSIBLE_MSVC_RUNTIMES "msvcr")
endif()
+ 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-")
endif()
- list(APPEND _Ruby_POSSIBLE_LIB_NAMES
- "${_Ruby_ARCH_PREFIX}msvcr${_Ruby_MSVC_RUNTIME}-ruby${_Ruby_NODOT_VERSION}"
- "${_Ruby_ARCH_PREFIX}msvcr${_Ruby_MSVC_RUNTIME}-ruby${_Ruby_NODOT_VERSION}-static"
- "${_Ruby_ARCH_PREFIX}msvcrt-ruby${_Ruby_NODOT_VERSION}"
- "${_Ruby_ARCH_PREFIX}msvcrt-ruby${_Ruby_NODOT_VERSION}-static" )
+ 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")
+ endforeach()
+ endforeach()
endif()
find_library(Ruby_LIBRARY NAMES ${_Ruby_POSSIBLE_LIB_NAMES} HINTS ${Ruby_POSSIBLE_LIB_DIR} )