From: Jonas Devlieghere Date: Thu, 18 Jul 2019 15:17:42 +0000 (+0000) Subject: [CMake] Don't set Python_ADDITIONAL_VERSIONS X-Git-Tag: llvmorg-11-init~14100 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5359b1b0754ff70b0a36917a5e61625c951b408;p=platform%2Fupstream%2Fllvm.git [CMake] Don't set Python_ADDITIONAL_VERSIONS 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 llvm-svn: 366447 --- diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index 6cf28d8..60937aa 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -129,7 +129,6 @@ 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 diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index ae4ed38..f26ae25 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -80,7 +80,6 @@ if (COMPILER_RT_STANDALONE_BUILD) endif() # Find Python interpreter. - set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5) include(FindPythonInterp) if(NOT PYTHONINTERP_FOUND) message(FATAL_ERROR " diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt index e2fbdbf..641f71c 100644 --- a/lld/CMakeLists.txt +++ b/lld/CMakeLists.txt @@ -56,7 +56,6 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) include(HandleLLVMOptions) if(LLVM_INCLUDE_TESTS) - set(Python_ADDITIONAL_VERSIONS 2.7) include(FindPythonInterp) if(NOT PYTHONINTERP_FOUND) message(FATAL_ERROR diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 32cb5c2..6a6d3f9 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -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 diff --git a/llvm/docs/GettingStarted.rst b/llvm/docs/GettingStarted.rst index 742c7b9..5f95095 100644 --- a/llvm/docs/GettingStarted.rst +++ b/llvm/docs/GettingStarted.rst @@ -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 |