[Lldb-commits] [lldb] r224929 - [cmake] Teach the standalone CMake build to find the Python interpreter

Chandler Carruth chandlerc at gmail.com
Mon Dec 29 04:32:27 PST 2014


Author: chandlerc
Date: Mon Dec 29 06:32:27 2014
New Revision: 224929

URL: http://llvm.org/viewvc/llvm-project?rev=224929&view=rev
Log:
[cmake] Teach the standalone CMake build to find the Python interpreter
the same way the LLVM CMake build does, notably using the proper CMake
module and specifically requesting an older Python version. LLDB relies
pretty heavily on not using Python 3 at this point, and without this
patch it ends up trying to use Python 3 which ends quite badly. =] With
this, I'm able to build LLDB in its standalone mode successfully on
Linux when I have both Python 2.7 and Python 3.3 installed.

Modified:
    lldb/trunk/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=224929&r1=224928&r2=224929&view=diff
==============================================================================
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Mon Dec 29 06:32:27 2014
@@ -71,6 +71,16 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
   include(AddLLVM)
   include(HandleLLVMOptions)
 
+  # Verify that we can find a Python 2 interpreter.  Python 3 is unsupported.
+  set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5)
+  include(FindPythonInterp)
+  if( NOT PYTHONINTERP_FOUND )
+    message(FATAL_ERROR
+  "Unable to find Python interpreter, required for builds and testing.
+
+  Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
+  endif()
+
   # Import CMake library targets from LLVM and Clang.
   include("${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake/LLVMConfig.cmake")
   include("${LLDB_PATH_TO_CLANG_BUILD}/share/clang/cmake/ClangConfig.cmake")





More information about the lldb-commits mailing list