Skip to content

Commit 1249f40

Browse files
committed
[lldb] Remove Python 2 fallback and only support Python 3
This removes the fallback to Python 2 and makes Python 3 the only supported configuration. This is the first step to fully migrate to Python 3 over the coming releases as discussed on the mailing list. http://lists.llvm.org/pipermail/lldb-dev/2020-August/016388.html As a reminder, for the current release the test suite and the generated bindings should remain compatible with Python 2. Differential revision: https://reviews.llvm.org/D85942 (cherry picked from commit ce439cb)
1 parent c37f535 commit 1249f40

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

lldb/cmake/modules/FindPythonInterpAndLibs.cmake

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -38,41 +38,12 @@ macro(FindPython3)
3838
endif()
3939
endmacro()
4040

41-
macro(FindPython2)
42-
# Use PYTHON_HOME as a hint to find Python 2.
43-
set(Python2_ROOT_DIR "${PYTHON_HOME}")
44-
find_package(Python2 COMPONENTS Interpreter Development)
45-
if(Python2_FOUND AND Python2_Interpreter_FOUND)
46-
set(PYTHON_LIBRARIES ${Python2_LIBRARIES})
47-
set(PYTHON_INCLUDE_DIRS ${Python2_INCLUDE_DIRS})
48-
set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE})
49-
50-
set(PYTHON2_FOUND TRUE)
51-
mark_as_advanced(
52-
PYTHON_LIBRARIES
53-
PYTHON_INCLUDE_DIRS
54-
PYTHON_EXECUTABLE
55-
SWIG_EXECUTABLE)
56-
endif()
57-
endmacro()
58-
5941
if(PYTHON_LIBRARIES AND PYTHON_INCLUDE_DIRS AND PYTHON_EXECUTABLE AND SWIG_EXECUTABLE)
6042
set(PYTHONINTERPANDLIBS_FOUND TRUE)
6143
else()
6244
find_package(SWIG 2.0)
6345
if (SWIG_FOUND)
64-
if (LLDB_PYTHON_VERSION)
65-
if (LLDB_PYTHON_VERSION VERSION_EQUAL "2")
66-
FindPython2()
67-
elseif(LLDB_PYTHON_VERSION VERSION_EQUAL "3")
68-
FindPython3()
69-
endif()
70-
else()
7146
FindPython3()
72-
if (NOT PYTHON3_FOUND AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
73-
FindPython2()
74-
endif()
75-
endif()
7647
else()
7748
message(STATUS "SWIG 2 or later is required for Python support in LLDB but could not be found")
7849
endif()

0 commit comments

Comments
 (0)