summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-08-12 15:13:08 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-08-12 15:13:16 (GMT)
commit0ca6d5766b2a2e37408065d9e77dd364e26f121a (patch)
treed98f310a1d43e8992c37aff0ad561834206e4c9f /Modules
parentedd908fc3994e28b760f206b07c75f7f7c4fac69 (diff)
parent951640f1f92e5da6f1c31135cc3aff527987ee67 (diff)
downloadCMake-0ca6d5766b2a2e37408065d9e77dd364e26f121a.zip
CMake-0ca6d5766b2a2e37408065d9e77dd364e26f121a.tar.gz
CMake-0ca6d5766b2a2e37408065d9e77dd364e26f121a.tar.bz2
Merge topic 'FindPython-manage-SOABI-in-all-versions' into release-3.18
951640f1f9 FindPython: manage SOABI for all Python versions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5119
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPython/Support.cmake16
1 files changed, 4 insertions, 12 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 9b65f39..a927a5d 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -486,7 +486,7 @@ function (_PYTHON_GET_CONFIG_VAR _PYTHON_PGCV_VALUE NAME)
endif()
elseif (NAME STREQUAL "SOABI")
execute_process (COMMAND ${_${_PYTHON_PREFIX}_INTERPRETER_LAUNCHER} "${_${_PYTHON_PREFIX}_EXECUTABLE}" -c
- "import sys\ntry:\n from distutils import sysconfig\n sys.stdout.write(';'.join([sysconfig.get_config_var('SOABI') or '',sysconfig.get_config_var('EXT_SUFFIX') or '']))\nexcept Exception:\n import sysconfig;sys.stdout.write(';'.join([sysconfig.get_config_var('SOABI') or '',sysconfig.get_config_var('EXT_SUFFIX') or '']))"
+ "import sys\ntry:\n from distutils import sysconfig\n sys.stdout.write(';'.join([sysconfig.get_config_var('SOABI') or '',sysconfig.get_config_var('EXT_SUFFIX') or '',sysconfig.get_config_var('SO') or '']))\nexcept Exception:\n import sysconfig;sys.stdout.write(';'.join([sysconfig.get_config_var('SOABI') or '',sysconfig.get_config_var('EXT_SUFFIX') or '',sysconfig.get_config_var('SO') or '']))"
RESULT_VARIABLE _result
OUTPUT_VARIABLE _soabi
ERROR_QUIET
@@ -522,7 +522,7 @@ function (_PYTHON_GET_CONFIG_VAR _PYTHON_PGCV_VALUE NAME)
endif()
endif()
- if (config_flag STREQUAL "ABIFLAGS")
+ if (NAME STREQUAL "ABIFLAGS" OR NAME STREQUAL "SOABI")
set (${_PYTHON_PGCV_VALUE} "${_values}" PARENT_SCOPE)
return()
endif()
@@ -1768,9 +1768,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
unset (${_PYTHON_PREFIX}_SITEARCH)
endif()
- if (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR VERSION_GREATER_EQUAL "3")
- _python_get_config_var (${_PYTHON_PREFIX}_SOABI SOABI)
- endif()
+ _python_get_config_var (${_PYTHON_PREFIX}_SOABI SOABI)
# store properties in the cache to speed-up future searches
set (_${_PYTHON_PREFIX}_INTERPRETER_PROPERTIES
@@ -2841,8 +2839,7 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
${_PYTHON_PREFIX}_PyPy_VERSION "${${_PYTHON_PREFIX}_PyPy_VERSION}")
endif()
- if (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR VERSION_GREATER_EQUAL "3"
- AND NOT DEFINED ${_PYTHON_PREFIX}_SOABI)
+ if (NOT DEFINED ${_PYTHON_PREFIX}_SOABI)
_python_get_config_var (${_PYTHON_PREFIX}_SOABI SOABI)
endif()
@@ -3092,11 +3089,6 @@ if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT")
function (__${_PYTHON_PREFIX}_ADD_LIBRARY prefix name)
cmake_parse_arguments (PARSE_ARGV 2 PYTHON_ADD_LIBRARY "STATIC;SHARED;MODULE;WITH_SOABI" "" "")
- if (prefix STREQUAL "Python2" AND PYTHON_ADD_LIBRARY_WITH_SOABI)
- message (AUTHOR_WARNING "FindPython2: Option `WITH_SOABI` is not supported for Python2 and will be ignored.")
- unset (PYTHON_ADD_LIBRARY_WITH_SOABI)
- endif()
-
if (PYTHON_ADD_LIBRARY_STATIC)
set (type STATIC)
elseif (PYTHON_ADD_LIBRARY_SHARED)