[PATCH] D52763: Reorder FindPythonInterp so that config-ix can use PYTHON_EXECUTABLE
Nathan Lanza via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 1 19:23:48 PDT 2018
lanza created this revision.
Herald added subscribers: llvm-commits, mgorny.
Code in config-ix tries to call `PYTHON_EXECUTABLE` to search for some
python modules but that variable isn't set until the moved chunk of
code that finds Python is called.
Reorder it so CMake can use PYTHON_EXECUTABLE
Repository:
rL LLVM
https://reviews.llvm.org/D52763
Files:
CMakeLists.txt
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -571,6 +571,22 @@
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR OFF CACHE BOOL
"Enable per-target runtimes directory")
+# Verify that we can find a Python 2 interpreter. Python 3 is unsupported.
+# FIXME: We should support systems with only Python 3, but that requires work
+# on LLDB.
+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()
+
# All options referred to from HandleLLVMOptions have to be specified
# BEFORE this include, otherwise options will not be correctly set on
# first cmake run
@@ -590,22 +606,6 @@
include(HandleLLVMOptions)
-# Verify that we can find a Python 2 interpreter. Python 3 is unsupported.
-# FIXME: We should support systems with only Python 3, but that requires work
-# on LLDB.
-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()
-
######
# LLVMBuild Integration
#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52763.167873.patch
Type: text/x-patch
Size: 1619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181002/2e2a951d/attachment.bin>
More information about the llvm-commits
mailing list