From 675eaf3bd0c045058da7bb3112474c5f2a5c25e3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 17 Mar 2020 08:39:06 -0400 Subject: FindRuby: Update MSVC runtime library selection Use the `MSVC_TOOLSET_VERSION` variable computed by CMake to get the matching Ruby library name component. Inspired-by: Julien Marrec --- Modules/FindRuby.cmake | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index 9543284..296f05b 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -242,21 +242,10 @@ 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_MSVC_RUNTIME "" ) - if( MSVC_VERSION EQUAL 1200 ) - set( _Ruby_MSVC_RUNTIME "60" ) - endif() - if( MSVC_VERSION EQUAL 1300 ) - set( _Ruby_MSVC_RUNTIME "70" ) - endif() - if( MSVC_VERSION EQUAL 1310 ) - set( _Ruby_MSVC_RUNTIME "71" ) - endif() - if( MSVC_VERSION EQUAL 1400 ) - set( _Ruby_MSVC_RUNTIME "80" ) - endif() - if( MSVC_VERSION EQUAL 1500 ) - set( _Ruby_MSVC_RUNTIME "90" ) + if(MSVC_TOOLSET_VERSION) + set(_Ruby_MSVC_RUNTIME "${MSVC_TOOLSET_VERSION}") + else() + set(_Ruby_MSVC_RUNTIME "") endif() set(_Ruby_ARCH_PREFIX "") -- cgit v0.12