[CMake] Actually require python 3.6 or greater

Previously, CMake would find any version of Python3. However, the project
claims to require 3.6 or greater, and 3.6 features are being used.

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D95635
This commit is contained in:
Christopher Tetreault 2021-01-29 09:11:38 -08:00
parent d6656c3b25
commit 0703b0753c
4 changed files with 4 additions and 4 deletions

View File

@ -131,7 +131,7 @@ 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)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter)
# Check prebuilt llvm/utils.
if(EXISTS ${LLVM_TOOLS_BINARY_DIR}/FileCheck${CMAKE_EXECUTABLE_SUFFIX}

View File

@ -57,7 +57,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
include(CheckAtomic)
if(LLVM_INCLUDE_TESTS)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter)
# Check prebuilt llvm/utils.
if(EXISTS ${LLVM_TOOLS_BINARY_DIR}/FileCheck${CMAKE_EXECUTABLE_SUFFIX}

View File

@ -697,7 +697,7 @@ set(ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER FALSE CACHE BOOL
include(HandleLLVMOptions)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter)
######

View File

@ -79,7 +79,7 @@ set(MLIR_PYTHON_BINDINGS_VERSION_LOCKED 1 CACHE BOOL
if(MLIR_BINDINGS_PYTHON_ENABLED)
include(MLIRDetectPythonEnv)
find_package(Python3 COMPONENTS Interpreter Development NumPy REQUIRED)
find_package(Python3 3.6 COMPONENTS Interpreter Development NumPy REQUIRED)
message(STATUS "Found python include dirs: ${Python3_INCLUDE_DIRS}")
message(STATUS "Found python libraries: ${Python3_LIBRARIES}")
message(STATUS "Found numpy v${Python3_NumPy_VERSION}: ${Python3_NumPy_INCLUDE_DIRS}")