Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FloorspaceJS to latest version #334

Merged
merged 1 commit into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions CMake/FindRuby.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ This module will set the following variables in your project:
``Ruby_INCLUDE_DIRS``
include dirs to be used when using the ruby library
``Ruby_LIBRARIES``
libraries needed to use ruby from C.
.. versionadded:: 3.18
libraries needed to use ruby from C.
``Ruby_VERSION``
the version of ruby which was found, e.g. "1.8.7"
``Ruby_VERSION_MAJOR``
Expand All @@ -47,9 +48,10 @@ This module will set the following variables in your project:
``Ruby_VERSION_PATCH``
Ruby patch version.


The following variables are also provided for compatibility reasons,
don't use them in new code:
.. versionchanged:: 3.18
Previous versions of CMake used the ``RUBY_`` prefix for all variables.
The following variables are provided for compatibility reasons,
don't use them in new code:

``RUBY_EXECUTABLE``
same as Ruby_EXECUTABLE.
Expand All @@ -67,6 +69,8 @@ don't use them in new code:
Hints
^^^^^

.. versionadded:: 3.18

``Ruby_ROOT_DIR``
Define the root directory of a Ruby installation.

Expand Down Expand Up @@ -401,6 +405,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
Expand Down Expand Up @@ -433,22 +438,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} )
Expand Down Expand Up @@ -515,6 +525,7 @@ foreach(Camel
Ruby_SITELIB_DIR
Ruby_HAS_VENDOR_RUBY
Ruby_VENDORARCH_DIR
Ruby_VENDORLIB_DIR

)
string(TOUPPER ${Camel} UPPER)
Expand Down
Loading