diff options
author | 2018-09-15 22:04:40 +0200 | |
---|---|---|
committer | 2019-07-25 10:54:04 +0000 | |
commit | ae0a09d9d471b0fa0a90a672f121dbfab3bffaaf (patch) | |
tree | 05e9ba355cac0b622570dcc333a57e4363c85a50 | |
parent | 50fa2811974abf0f3e8e9aa727b3a8e5c22ac9ac (diff) | |
download | paludis-ae0a09d9d471b0fa0a90a672f121dbfab3bffaaf.tar.gz paludis-ae0a09d9d471b0fa0a90a672f121dbfab3bffaaf.tar.xz |
build: Make changing supported Ruby ABIs a one-stop change
The option description and the actually supported ABI version
got out of sync with the last updates. Prevent this from happening
again by keeping the information in one place only
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 15927ce37..af489dfcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,8 @@ endif() set(PALUDIS_VIM_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/vim/vimfiles" CACHE PATH "vim installation directory") -set(RUBY_VERSION "2.3" CACHE STRING "Ruby Version (2.1;2.2;2.3)") +set(RUBY_SUPPORTED_VERSIONS 2.1 2.2 2.3 2.4 2.5 2.6) +set(RUBY_VERSION "2.3" CACHE STRING "Ruby Version (${RUBY_SUPPORTED_VERSIONS})") set(CMAKE_THREAD_PREFER_PTHREAD TRUE) set(THREADS_PREFER_PTHREAD_FLAG TRUE) @@ -336,13 +337,10 @@ if(ENABLE_PYTHON_DOCS) endif() if(ENABLE_RUBY) - if(NOT "${RUBY_VERSION}" STREQUAL "2.1" AND - NOT "${RUBY_VERSION}" STREQUAL "2.2" AND - NOT "${RUBY_VERSION}" STREQUAL "2.3" AND - NOT "${RUBY_VERSION}" STREQUAL "2.4" AND - NOT "${RUBY_VERSION}" STREQUAL "2.5" AND - NOT "${RUBY_VERSION}" STREQUAL "2.6") - message(SEND_ERROR "invalid ruby version specified (${RUBY_VERSION})") + list(FIND RUBY_SUPPORTED_VERSIONS "${RUBY_VERSION}" _ruby_version_index) + + if(_ruby_version_index EQUAL -1) + message(SEND_ERROR "invalid ruby version specified (${RUBY_VERSION})") endif() find_package(Ruby ${RUBY_VERSION} REQUIRED) |