JDevlieghere created this revision. JDevlieghere added a reviewer: LLDB. Herald added a subscriber: mgorny. JDevlieghere requested review of this revision.
This removes the fallback to Python 2 and makes Python 3 the only supported configuration. This is the first step as proposed on the mailing list http://lists.llvm.org/pipermail/lldb-dev/2020-August/016387.html() to fully migrate to Python 3 over the coming releases. Repository: rLLDB LLDB https://reviews.llvm.org/D85942 Files: lldb/cmake/modules/FindPythonInterpAndLibs.cmake Index: lldb/cmake/modules/FindPythonInterpAndLibs.cmake =================================================================== --- lldb/cmake/modules/FindPythonInterpAndLibs.cmake +++ lldb/cmake/modules/FindPythonInterpAndLibs.cmake @@ -38,41 +38,12 @@ endif() endmacro() -macro(FindPython2) - # Use PYTHON_HOME as a hint to find Python 2. - set(Python2_ROOT_DIR "${PYTHON_HOME}") - find_package(Python2 COMPONENTS Interpreter Development) - if(Python2_FOUND AND Python2_Interpreter_FOUND) - set(PYTHON_LIBRARIES ${Python2_LIBRARIES}) - set(PYTHON_INCLUDE_DIRS ${Python2_INCLUDE_DIRS}) - set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE}) - - set(PYTHON2_FOUND TRUE) - mark_as_advanced( - PYTHON_LIBRARIES - PYTHON_INCLUDE_DIRS - PYTHON_EXECUTABLE - SWIG_EXECUTABLE) - endif() -endmacro() - if(PYTHON_LIBRARIES AND PYTHON_INCLUDE_DIRS AND PYTHON_EXECUTABLE AND SWIG_EXECUTABLE) set(PYTHONINTERPANDLIBS_FOUND TRUE) else() find_package(SWIG 2.0) if (SWIG_FOUND) - if (LLDB_PYTHON_VERSION) - if (LLDB_PYTHON_VERSION VERSION_EQUAL "2") - FindPython2() - elseif(LLDB_PYTHON_VERSION VERSION_EQUAL "3") - FindPython3() - endif() - else() FindPython3() - if (NOT PYTHON3_FOUND AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows) - FindPython2() - endif() - endif() else() message(STATUS "SWIG 2 or later is required for Python support in LLDB but could not be found") endif()
Index: lldb/cmake/modules/FindPythonInterpAndLibs.cmake =================================================================== --- lldb/cmake/modules/FindPythonInterpAndLibs.cmake +++ lldb/cmake/modules/FindPythonInterpAndLibs.cmake @@ -38,41 +38,12 @@ endif() endmacro() -macro(FindPython2) - # Use PYTHON_HOME as a hint to find Python 2. - set(Python2_ROOT_DIR "${PYTHON_HOME}") - find_package(Python2 COMPONENTS Interpreter Development) - if(Python2_FOUND AND Python2_Interpreter_FOUND) - set(PYTHON_LIBRARIES ${Python2_LIBRARIES}) - set(PYTHON_INCLUDE_DIRS ${Python2_INCLUDE_DIRS}) - set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE}) - - set(PYTHON2_FOUND TRUE) - mark_as_advanced( - PYTHON_LIBRARIES - PYTHON_INCLUDE_DIRS - PYTHON_EXECUTABLE - SWIG_EXECUTABLE) - endif() -endmacro() - if(PYTHON_LIBRARIES AND PYTHON_INCLUDE_DIRS AND PYTHON_EXECUTABLE AND SWIG_EXECUTABLE) set(PYTHONINTERPANDLIBS_FOUND TRUE) else() find_package(SWIG 2.0) if (SWIG_FOUND) - if (LLDB_PYTHON_VERSION) - if (LLDB_PYTHON_VERSION VERSION_EQUAL "2") - FindPython2() - elseif(LLDB_PYTHON_VERSION VERSION_EQUAL "3") - FindPython3() - endif() - else() FindPython3() - if (NOT PYTHON3_FOUND AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows) - FindPython2() - endif() - endif() else() message(STATUS "SWIG 2 or later is required for Python support in LLDB but could not be found") endif()
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits