@@ -61,46 +61,22 @@ if(PYTHON_LIBRARIES AND PYTHON_INCLUDE_DIRS AND PYTHON_EXECUTABLE AND SWIG_EXECU
6161else ()
6262 find_package (SWIG 2.0)
6363 if (SWIG_FOUND)
64- if (NOT CMAKE_VERSION VERSION_LESS 3.12)
65- if (LLDB_PYTHON_VERSION)
66- if (LLDB_PYTHON_VERSION VERSION_EQUAL "2" )
67- FindPython2()
68- elseif (LLDB_PYTHON_VERSION VERSION_EQUAL "3" )
69- FindPython3()
70- endif ()
71- else ()
64+ if (LLDB_PYTHON_VERSION)
65+ if (LLDB_PYTHON_VERSION VERSION_EQUAL "2" )
66+ FindPython2()
67+ elseif (LLDB_PYTHON_VERSION VERSION_EQUAL "3" )
7268 FindPython3()
73- if (NOT PYTHON3_FOUND AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
74- FindPython2()
75- endif ()
7669 endif ()
7770 else ()
78- find_package (PythonInterp)
79- find_package (PythonLibs)
80- if (PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND AND SWIG_FOUND)
81- if (NOT CMAKE_CROSSCOMPILING )
82- string (REPLACE "." ";" pythonlibs_version_list ${PYTHONLIBS_VERSION_STRING} )
83- list (GET pythonlibs_version_list 0 pythonlibs_major)
84- list (GET pythonlibs_version_list 1 pythonlibs_minor)
85-
86- # Ignore the patch version. Some versions of macOS report a different
87- # patch version for the system provided interpreter and libraries.
88- if (CMAKE_CROSSCOMPILING OR (PYTHON_VERSION_MAJOR VERSION_EQUAL pythonlibs_major AND
89- PYTHON_VERSION_MINOR VERSION_EQUAL pythonlibs_minor))
90- mark_as_advanced (
91- PYTHON_LIBRARIES
92- PYTHON_INCLUDE_DIRS
93- PYTHON_EXECUTABLE
94- SWIG_EXECUTABLE)
95- endif ()
96- endif ()
71+ FindPython3()
72+ if (NOT PYTHON3_FOUND AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
73+ FindPython2()
9774 endif ()
9875 endif ()
9976 else ()
10077 message (STATUS "SWIG 2 or later is required for Python support in LLDB but could not be found" )
10178 endif ()
10279
103-
10480 include (FindPackageHandleStandardArgs)
10581 find_package_handle_standard_args(PythonInterpAndLibs
10682 FOUND_VAR
0 commit comments