--- llvm-9.0.0.src/CMakeLists.txt.orig 2019-08-26 14:31:37.000000000 +0200 +++ llvm-9.0.0.src/CMakeLists.txt 2019-12-04 00:12:17.536142461 +0100 @@ -612,6 +612,18 @@ set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR OFF CACHE BOOL "Enable per-target runtimes directory") +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() + # All options referred to from HandleLLVMOptions have to be specified # BEFORE this include, otherwise options will not be correctly set on # first cmake run @@ -642,18 +654,6 @@ include(HandleLLVMOptions) -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() - ###### # LLVMBuild Integration #