build: use `find_package(Python3)` rather than `PYTHON_HOME`
authorSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 23 Dec 2019 04:45:46 +0000 (20:45 -0800)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 23 Dec 2019 04:47:25 +0000 (20:47 -0800)
The behaviour of `PYTHON_HOME` can be emulated by setting
`Python3_EXECUTABLE` to the absolute path instead of the custom variable
now that we can find the python interpreter.

lldb/cmake/modules/LLDBConfig.cmake

index e1da76c..674b024 100644 (file)
@@ -148,6 +148,7 @@ if (LLDB_ENABLE_PYTHON)
     include_directories(${Python3_INCLUDE_DIRS})
 
     if (NOT LLDB_RELOCATABLE_PYTHON)
+      get_filename_component(PYTHON_HOME "${Python3_EXECUTABLE}" DIRECTORY)
       file(TO_CMAKE_PATH "${PYTHON_HOME}" LLDB_PYTHON_HOME)
     endif()
   else()