summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2015-10-08 08:50:20 +0000
committerBruce Mitchener <bruce.mitchener@gmail.com>2015-10-08 08:50:20 +0000
commit3ddef773ad5c994988c2f753f6d7107d74eeb4e8 (patch)
tree89f24733f864f7d7fd8cee7da78008cce17f0fc9
parent475f9eabc27a4ee3c0debfe48511f62b7a4bf418 (diff)
downloadbcm5719-llvm-3ddef773ad5c994988c2f753f6d7107d74eeb4e8.tar.gz
bcm5719-llvm-3ddef773ad5c994988c2f753f6d7107d74eeb4e8.zip
Make CMake display more readable paths to Python binaries on Windows
Summary: Previously CMake would display messages like these: ``` -- LLDB Found PythonExecutable: $<$<CONFIG:Debug>:C:/Projects/Python-2.7.9-bin/x64/python_d.exe>$<$<NOT:$<CONFIG:Debug>>:C:/Projects/Python-2.7.9-bin/x64/python.exe> -- LLDB Found PythonLibs: $<$<CONFIG:Debug>:C:/Projects/Python-2.7.9-bin/x64/libs/python27_d.lib>$<$<NOT:$<CONFIG:Debug>>:C:/Projects/Python-2.7.9-bin/x64/libs/python27.lib> -- LLDB Found PythonDLL: $<$<CONFIG:Debug>:C:/Projects/Python-2.7.9-bin/x64/python27_d.dll>$<$<NOT:$<CONFIG:Debug>>:C:/Projects/Python-2.7.9-bin/x64/python27.dll> ``` This patch makes the messages look like this: ``` -- LLDB Found PythonExecutable: C:/Projects/Python-2.7.9-bin/x64/python.exe and C:/Projects/Python-2.7.9-bin/x64/python_d.exe -- LLDB Found PythonLibs: C:/Projects/Python-2.7.9-bin/x64/libs/python27.lib and C:/Projects/Python-2.7.9-bin/x64/libs/python27_d.lib -- LLDB Found PythonDLL: C:/Projects/Python-2.7.9-bin/x64/python27.dll and C:/Projects/Python-2.7.9-bin/x64/python27_d.dll ``` I've also added checks to ensure the messages are actually accurate, as in check that the files actually exist before claiming they've been found. If any of the files are missing Python integration will be disabled for the build. Patch by Vadim Macagon. Thanks! Reviewers: brucem, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13520 llvm-svn: 249671
-rw-r--r--lldb/cmake/modules/LLDBConfig.cmake42
1 files changed, 39 insertions, 3 deletions
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index b8133574e00..08d6a9195ea 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -83,6 +83,42 @@ function(find_python_libs_windows)
file(TO_CMAKE_PATH "${PYTHON_HOME}/libs/${PYTHONLIBS_BASE_NAME}.lib" PYTHON_RELEASE_LIB)
file(TO_CMAKE_PATH "${PYTHON_HOME}/${PYTHONLIBS_BASE_NAME}.dll" PYTHON_RELEASE_DLL)
+ if (NOT EXISTS ${PYTHON_DEBUG_EXE})
+ message("Unable to find ${PYTHON_DEBUG_EXE}")
+ unset(PYTHON_DEBUG_EXE)
+ endif()
+
+ if (NOT EXISTS ${PYTHON_RELEASE_EXE})
+ message("Unable to find ${PYTHON_RELEASE_EXE}")
+ unset(PYTHON_RELEASE_EXE)
+ endif()
+
+ if (NOT EXISTS ${PYTHON_DEBUG_LIB})
+ message("Unable to find ${PYTHON_DEBUG_LIB}")
+ unset(PYTHON_DEBUG_LIB)
+ endif()
+
+ if (NOT EXISTS ${PYTHON_RELEASE_LIB})
+ message("Unable to find ${PYTHON_RELEASE_LIB}")
+ unset(PYTHON_RELEASE_LIB)
+ endif()
+
+ if (NOT EXISTS ${PYTHON_DEBUG_DLL})
+ message("Unable to find ${PYTHON_DEBUG_DLL}")
+ unset(PYTHON_DEBUG_DLL)
+ endif()
+
+ if (NOT EXISTS ${PYTHON_RELEASE_DLL})
+ message("Unable to find ${PYTHON_RELEASE_DLL}")
+ unset(PYTHON_RELEASE_DLL)
+ endif()
+
+ if (NOT (PYTHON_DEBUG_EXE AND PYTHON_RELEASE_EXE AND PYTHON_DEBUG_LIB AND PYTHON_RELEASE_LIB AND PYTHON_DEBUG_DLL AND PYTHON_RELEASE_DLL))
+ message("Python installation is corrupt. Python support will be disabled for this build.")
+ set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)
+ return()
+ endif()
+
# Generator expressions are evaluated in the context of each build configuration generated
# by CMake. Here we use the $<CONFIG:Debug>:VALUE logical generator expression to ensure
# that the debug Python library, DLL, and executable are used in the Debug build configuration.
@@ -113,9 +149,9 @@ function(find_python_libs_windows)
set (PYTHON_DLL ${PYTHON_DLL} PARENT_SCOPE)
set (PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} PARENT_SCOPE)
- message("-- LLDB Found PythonExecutable: ${PYTHON_EXECUTABLE}")
- message("-- LLDB Found PythonLibs: ${PYTHON_LIBRARY}")
- message("-- LLDB Found PythonDLL: ${PYTHON_DLL}")
+ message("-- LLDB Found PythonExecutable: ${PYTHON_RELEASE_EXE} and ${PYTHON_DEBUG_EXE}")
+ message("-- LLDB Found PythonLibs: ${PYTHON_RELEASE_LIB} and ${PYTHON_DEBUG_LIB}")
+ message("-- LLDB Found PythonDLL: ${PYTHON_RELEASE_DLL} and ${PYTHON_DEBUG_DLL}")
message("-- LLDB Found PythonIncludeDirs: ${PYTHON_INCLUDE_DIRS}")
endfunction(find_python_libs_windows)
OpenPOWER on IntegriCloud