Skip to content

Commit a5359b1

Browse files
committed
[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
1 parent ac958c2 commit a5359b1

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

clang/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
129129
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
130130

131131
if(LLVM_INCLUDE_TESTS)
132-
set(Python_ADDITIONAL_VERSIONS 2.7)
133132
include(FindPythonInterp)
134133
if(NOT PYTHONINTERP_FOUND)
135134
message(FATAL_ERROR

compiler-rt/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ if (COMPILER_RT_STANDALONE_BUILD)
8080
endif()
8181

8282
# Find Python interpreter.
83-
set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5)
8483
include(FindPythonInterp)
8584
if(NOT PYTHONINTERP_FOUND)
8685
message(FATAL_ERROR "

lld/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
5656
include(HandleLLVMOptions)
5757

5858
if(LLVM_INCLUDE_TESTS)
59-
set(Python_ADDITIONAL_VERSIONS 2.7)
6059
include(FindPythonInterp)
6160
if(NOT PYTHONINTERP_FOUND)
6261
message(FATAL_ERROR

llvm/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,6 @@ option(LLVM_ENABLE_PLUGINS "Enable plugin support" ${LLVM_ENABLE_PLUGINS_default
642642

643643
include(HandleLLVMOptions)
644644

645-
# We support both Python 2 and 3.
646-
set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 2.7)
647645
include(FindPythonInterp)
648646
if( NOT PYTHONINTERP_FOUND )
649647
message(FATAL_ERROR

llvm/docs/GettingStarted.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,11 @@ used by people developing LLVM.
598598
| CMAKE_INSTALL_PREFIX | Specifies the install directory to target when |
599599
| | running the install action of the build files. |
600600
+-------------------------+----------------------------------------------------+
601+
| PYTHON_EXECUTABLE | Forces CMake to use a specific Python version by |
602+
| | passing a path to a Python interpreter. By default |
603+
| | the Python version of the interpreter in your PATH |
604+
| | is used. |
605+
+-------------------------+----------------------------------------------------+
601606
| LLVM_TARGETS_TO_BUILD | A semicolon delimited list controlling which |
602607
| | targets will be built and linked into llvm. |
603608
| | The default list is defined as |

0 commit comments

Comments
 (0)