summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-04-20 13:24:19 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-04-20 13:29:50 (GMT)
commit5440eafaae078153c4b397c4b04e987690f63dc0 (patch)
treef287587ee520ab8742161bd579ed8ab17382b1cb /Modules
parent33c6d01e8264706c692a04dc51e2993150fdfd0b (diff)
downloadCMake-5440eafaae078153c4b397c4b04e987690f63dc0.zip
CMake-5440eafaae078153c4b397c4b04e987690f63dc0.tar.gz
CMake-5440eafaae078153c4b397c4b04e987690f63dc0.tar.bz2
FindPython: Add support for pypy v7.3.9 and uppers
Library name versioning has changed. Fixes: #23439
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPython/Support.cmake13
1 files changed, 12 insertions, 1 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index afe9743..8391f16 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -415,7 +415,6 @@ function (_PYTHON_GET_NAMES _PYTHON_PGN_NAMES)
if (_PGN_WIN32)
foreach (version IN LISTS _PGN_VERSION)
string (REPLACE "." "" version_no_dots ${version})
-
set (name "python${version_no_dots}")
if (_PGN_DEBUG)
string (APPEND name "_d")
@@ -423,6 +422,13 @@ function (_PYTHON_GET_NAMES _PYTHON_PGN_NAMES)
list (APPEND names "${name}")
endforeach()
endif()
+
+ if (_PGN_POSIX)
+ foreach(version IN LISTS _PGN_VERSION)
+ list (APPEND names "pypy${version}-c")
+ endforeach()
+ endif()
+
list (APPEND names ${_${_PYTHON_PREFIX}_PYPY_LIB_NAMES})
endif()
endif()
@@ -588,6 +594,11 @@ function (_PYTHON_GET_VERSION)
set (${_PGV_PREFIX}VERSION_MINOR "${CMAKE_MATCH_2}" PARENT_SCOPE)
set (${_PGV_PREFIX}VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}" PARENT_SCOPE)
set (${_PGV_PREFIX}ABI "${CMAKE_MATCH_3}" PARENT_SCOPE)
+ elseif (library_name MATCHES "pypy([23])\\.([0-9]+)-c")
+ set (${_PGV_PREFIX}VERSION_MAJOR "${CMAKE_MATCH_1}" PARENT_SCOPE)
+ set (${_PGV_PREFIX}VERSION_MINOR "${CMAKE_MATCH_2}" PARENT_SCOPE)
+ set (${_PGV_PREFIX}VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}" PARENT_SCOPE)
+ set (${_PGV_PREFIX}ABI "" PARENT_SCOPE)
elseif (library_name MATCHES "pypy(3)?-c")
set (version "${CMAKE_MATCH_1}")
# try to pick-up a more precise version from the path