[Mlir-commits] [mlir] cb31852 - [MLIR] [CMake/Python] Fix ignored Python3_EXECUTABLE

John Demme llvmlistbot at llvm.org
Thu Mar 10 07:50:48 PST 2022


Author: John Demme
Date: 2022-03-10T07:43:43-08:00
New Revision: cb318526b0417b1a03255ee79920ad613b0ae691

URL: https://github.com/llvm/llvm-project/commit/cb318526b0417b1a03255ee79920ad613b0ae691
DIFF: https://github.com/llvm/llvm-project/commit/cb318526b0417b1a03255ee79920ad613b0ae691.diff

LOG: [MLIR] [CMake/Python] Fix ignored Python3_EXECUTABLE

On Windows (at least), cmake ignores Python3_EXECUTABLE unless the
'Interpreter' component is being found. If the user is specifying a
different version than the latest installed (say, 3.8 vs 3.9) with the
Python3_EXECUTABLE, cmake was using a combination of the newest version
and the desired version. Mitigated by adding 'Interpreter' in the first
invocation like the second one.

Added: 
    

Modified: 
    mlir/cmake/modules/MLIRDetectPythonEnv.cmake

Removed: 
    


################################################################################
diff  --git a/mlir/cmake/modules/MLIRDetectPythonEnv.cmake b/mlir/cmake/modules/MLIRDetectPythonEnv.cmake
index cb1fea1b55486..7cbad493d247a 100644
--- a/mlir/cmake/modules/MLIRDetectPythonEnv.cmake
+++ b/mlir/cmake/modules/MLIRDetectPythonEnv.cmake
@@ -29,7 +29,7 @@ macro(mlir_configure_python_dev_packages)
       # Development.Module in some environments. However, in other environments
       # it may interfere with the subsequent search for Development.Module.
       find_package(Python3 ${LLVM_MINIMUM_PYTHON_VERSION}
-        COMPONENTS Development)
+        COMPONENTS Interpreter Development)
     endif()
     set(_python_development_component Development.Module)
   endif()


        


More information about the Mlir-commits mailing list