[Mlir-commits] [mlir] [mlir][CMake] enable disabling MLIR_ENABLE_EXECUTION_ENGINE (PR #171060)

Maksim Levental llvmlistbot at llvm.org
Sun Dec 7 14:57:41 PST 2025


https://github.com/makslevental created https://github.com/llvm/llvm-project/pull/171060

Currently if you pass MLIR_ENABLE_EXECUTION_ENGINE=OFF it's overwritten.

>From 090c0bb4558e4f23a794506ff5f07832b1cedf8b Mon Sep 17 00:00:00 2001
From: Maksim Levental <maksim.levental at gmail.com>
Date: Sun, 7 Dec 2025 16:57:31 -0600
Subject: [PATCH] [mlir][CMake] enable disabling MLIR_ENABLE_EXECUTION_ENGINE

Currently if you pass MLIR_ENABLE_EXECUTION_ENGINE=OFF it's overwritten.
---
 mlir/CMakeLists.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 570fb6f89dd1c..9e1e9314511e3 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -124,10 +124,13 @@ set_target_properties(mlir-doc PROPERTIES FOLDER "MLIR/Docs")
 
 # Only enable execution engine if the native target is available.
 if(${LLVM_NATIVE_ARCH} IN_LIST LLVM_TARGETS_TO_BUILD)
-  set(MLIR_ENABLE_EXECUTION_ENGINE 1)
+  set(MLIR_ENABLE_EXECUTION_ENGINE_default 1)
 else()
-  set(MLIR_ENABLE_EXECUTION_ENGINE 0)
+  set(MLIR_ENABLE_EXECUTION_ENGINE_default 0)
 endif()
+option(MLIR_ENABLE_EXECUTION_ENGINE
+       "Enable building the MLIR Execution Engine."
+       ${MLIR_ENABLE_EXECUTION_ENGINE_default})
 
 # Build the ROCm conversions and run according tests if the AMDGPU backend
 # is available.



More information about the Mlir-commits mailing list