diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -762,8 +762,6 @@ set(LLVM_PROFDATA_FILE "" CACHE FILEPATH "Profiling data file to use when compiling in order to improve runtime performance.") -# Find python before including config-ix, since it needs to be able to search -# for python modules. if(LLVM_INCLUDE_TESTS) # Lit test suite requires at least python 3.6 set(LLVM_MINIMUM_PYTHON_VERSION 3.6) @@ -772,6 +770,8 @@ set(LLVM_MINIMUM_PYTHON_VERSION 3.0) endif() +# Find python before including config-ix, since it needs to be able to search +# for python modules. find_package(Python3 ${LLVM_MINIMUM_PYTHON_VERSION} REQUIRED COMPONENTS Interpreter)