[lldb/CMake] Use PYTHON_HOME as a hint to find Python 3.

http://lists.llvm.org/pipermail/lldb-dev/2020-February/015998.html

Differential revision: https://reviews.llvm.org/D75275
This commit is contained in:
Jonas Devlieghere 2020-02-27 13:17:19 -08:00
parent 3156b1cf14
commit 04a91deebb

View File

@ -10,6 +10,8 @@ else()
find_package(SWIG 2.0)
if (SWIG_FOUND)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
# Use PYTHON_HOME as a hint to find Python 3.
set(Python3_ROOT_DIR PYTHON_HOME)
find_package(Python3 COMPONENTS Interpreter Development)
if (Python3_FOUND AND Python3_Interpreter_FOUND)
set(PYTHON_LIBRARIES ${Python3_LIBRARIES})