summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2015-08-21 09:38:46 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2015-08-21 09:38:46 +0000
commitcbac61a7804cfe8f58d97425ead7012141520d2e (patch)
tree6334b5cfbb0f1975ef4318cde58e05da9a414ffc
parentcac8b2eb73aa0cb04a795d51a804e0e9289ce94c (diff)
downloadbcm5719-llvm-cbac61a7804cfe8f58d97425ead7012141520d2e.tar.gz
bcm5719-llvm-cbac61a7804cfe8f58d97425ead7012141520d2e.zip
[CMake][Standalone] Detect Python. Python is used for Lit testing.
llvm-svn: 245685
-rw-r--r--clang/CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 67b44ffa84e..87c9ce82868 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -116,6 +116,19 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
if(LLVM_INCLUDE_TESTS)
+ set(Python_ADDITIONAL_VERSIONS 2.7)
+ 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()
+
+ if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
+ message(FATAL_ERROR "Python 2.7 or newer is required")
+ endif()
+
# Check prebuilt llvm/utils.
if(EXISTS ${LLVM_TOOLS_BINARY_DIR}/FileCheck${CMAKE_EXECUTABLE_SUFFIX}
AND EXISTS ${LLVM_TOOLS_BINARY_DIR}/count${CMAKE_EXECUTABLE_SUFFIX}
OpenPOWER on IntegriCloud