]> granicus.if.org Git - llvm/commitdiff
[CMake] Don't set Python_ADDITIONAL_VERSIONS
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 18 Jul 2019 15:17:42 +0000 (15:17 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 18 Jul 2019 15:17:42 +0000 (15:17 +0000)
Until recently, Python_ADDITIONAL_VERSIONS was used to limit LLVM's
Python support to 2.7. Now that both LLVM and LLDB both support Python
3, there's no longer a need to put an arbitrary limit on this.

However, instead of removing the variable, r365692 expanded the list,
which has the (presumably unintentional) side-effect of expression
preference for Python 3.

Instead, as Michal proposed in the original code review, we should just
not set the list at all, and let CMake pick whatever Python interpreter
you have in your path.

This patch removes the Python_ADDITIONAL_VERSIONS variable in llvm,
clang and lld. I've also updated the docs with the default behavior and
how to force a different Python version to be used.

Differential revision: https://reviews.llvm.org/D64894

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366447 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt
docs/GettingStarted.rst

index 32cb5c2c3e25b24eaeb775f44a640e94b40f96f9..6a6d3f943d5906500e462ef9b7f533367c23c4f2 100644 (file)
@@ -642,8 +642,6 @@ option(LLVM_ENABLE_PLUGINS "Enable plugin support" ${LLVM_ENABLE_PLUGINS_default
 
 include(HandleLLVMOptions)
 
-# We support both Python 2 and 3.
-set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 2.7)
 include(FindPythonInterp)
 if( NOT PYTHONINTERP_FOUND )
   message(FATAL_ERROR
index 742c7b96bc891d00289f12ea6eb2f4d28e8a4c43..5f95095c7191468c11a5360acfbbd71ba0f9642a 100644 (file)
@@ -598,6 +598,11 @@ used by people developing LLVM.
 | CMAKE_INSTALL_PREFIX    | Specifies the install directory to target when     |
 |                         | running the install action of the build files.     |
 +-------------------------+----------------------------------------------------+
+| PYTHON_EXECUTABLE       | Forces CMake to use a specific Python version by   |
+|                         | passing a path to a Python interpreter. By default |
+|                         | the Python version of the interpreter in your PATH |
+|                         | is used.                                           |
++-------------------------+----------------------------------------------------+
 | LLVM_TARGETS_TO_BUILD   | A semicolon delimited list controlling which       |
 |                         | targets will be built and linked into llvm.        |
 |                         | The default list is defined as                     |