summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Langford <apl@fb.com>2019-10-08 18:38:46 +0000
committerAlex Langford <apl@fb.com>2019-10-08 18:38:46 +0000
commit28fcc033c883f95416e920ff05f629df2c560a23 (patch)
tree4864a796dedfa7a218e0812fbe5a460bb0bbcd35
parent05e46979d2f4ba709400e43716b5c37d3d46d329 (diff)
downloadbcm5719-llvm-28fcc033c883f95416e920ff05f629df2c560a23.tar.gz
bcm5719-llvm-28fcc033c883f95416e920ff05f629df2c560a23.zip
[CMake] Fix building without python on Windows
Summary: find_python_libs_windows might set LLDB_DISABLE_PYTHON to ON. Unfortunately we do not re-check this variable before using variables filled in by find_python_libs_windows, leading to a failed configuration. llvm-svn: 374100
-rw-r--r--lldb/cmake/modules/LLDBConfig.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index e409d737d76..6c6930d86e8 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -267,10 +267,15 @@ function(find_python_libs_windows)
message(STATUS "LLDB Found PythonIncludeDirs: ${PYTHON_INCLUDE_DIR}")
endfunction(find_python_libs_windows)
+# Call find_python_libs_windows ahead of the rest of the python configuration.
+# It's possible that it won't find a python installation and will then set
+# LLDB_DISABLE_PYTHON to ON.
+if (NOT LLDB_DISABLE_PYTHON AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
+ find_python_libs_windows()
+endif()
+
if (NOT LLDB_DISABLE_PYTHON)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
- find_python_libs_windows()
-
if (NOT LLDB_RELOCATABLE_PYTHON)
file(TO_CMAKE_PATH "${PYTHON_HOME}" LLDB_PYTHON_HOME)
add_definitions( -DLLDB_PYTHON_HOME="${LLDB_PYTHON_HOME}" )
OpenPOWER on IntegriCloud