Downgrade LIMITED_API_VERSION, if python3 is older than 3.6.

pull/24860/head
Alexander Smorkalov 11 months ago
parent 2791bb7062
commit 985506c251
  1. 7
      cmake/OpenCVDetectPython.cmake

@ -295,7 +295,12 @@ find_python("${OPENCV_PYTHON3_VERSION}" "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYT
OCV_OPTION(PYTHON3_LIMITED_API "Build with Python Limited API (not available with numpy >=1.15 <1.17)" NO
VISIBLE_IF PYTHON3_NUMPY_VERSION VERSION_LESS "1.15" OR NOT PYTHON3_NUMPY_VERSION VERSION_LESS "1.17")
if(PYTHON3_LIMITED_API)
set(PYTHON3_LIMITED_API_VERSION "0x03060000" CACHE STRING "Minimal Python version for Limited API")
set(_default_ver "0x03060000")
if(PYTHON3_VERSION_STRING VERSION_LESS "3.6")
# fix for older pythons
set(_default_ver "0x030${PYTHON3_VERSION_MINOR}0000")
endif()
set(PYTHON3_LIMITED_API_VERSION ${_default_ver} CACHE STRING "Minimal Python version for Limited API")
endif()
if(PYTHON_DEFAULT_EXECUTABLE)

Loading…
Cancel
Save