FindRuby: Fix finding 64-bit Ruby on Windows

Ruby 2.0.0 and 2.1.5 have 64-bit binaries for Windows, with "x64-"
prefix.
This commit is contained in:
Michael Smith 2015-02-06 12:21:51 -08:00 committed by Brad King
parent d46e1e3f0f
commit e5ef9271a1
1 changed files with 9 additions and 4 deletions

View File

@ -234,11 +234,16 @@ if(WIN32)
set( _RUBY_MSVC_RUNTIME "90" )
endif()
set(_RUBY_ARCH_PREFIX "")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_RUBY_ARCH_PREFIX "x64-")
endif()
list(APPEND _RUBY_POSSIBLE_LIB_NAMES
"msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}"
"msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}-static"
"msvcrt-ruby${_RUBY_NODOT_VERSION}"
"msvcrt-ruby${_RUBY_NODOT_VERSION}-static" )
"${_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" )
endif()
find_library(RUBY_LIBRARY NAMES ${_RUBY_POSSIBLE_LIB_NAMES} HINTS ${RUBY_POSSIBLE_LIB_DIR} )