[Mlir-commits] [mlir] 1651159 - [MLIR] Install missing standalone helper tools (#205066)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jul 13 01:33:42 PDT 2026


Author: Momchil Velikov
Date: 2026-07-13T09:33:38+01:00
New Revision: 1651159f32cfcf82ecbb364dbf879e97b53d8060

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

LOG: [MLIR] Install missing standalone helper tools (#205066)

Standalone MLIR installs CMake package files that can reference helper
executables needed by downstream builds. Most helper tools already have
install paths available through existing LLVM tool and utility install
options, but `mlir-src-sharder` does not pass an install destination to
`add_tablegen` and `mlir-irdl-to-cpp` does not define an install rule.

Install those two missing helpers.

Co-authored-by: Luca Fancellu <luca.fancellu at arm.com>

Added: 
    

Modified: 
    mlir/tools/mlir-irdl-to-cpp/CMakeLists.txt
    mlir/tools/mlir-src-sharder/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-irdl-to-cpp/CMakeLists.txt b/mlir/tools/mlir-irdl-to-cpp/CMakeLists.txt
index 27a7e22db7d7b..5b69b364c6b32 100644
--- a/mlir/tools/mlir-irdl-to-cpp/CMakeLists.txt
+++ b/mlir/tools/mlir-irdl-to-cpp/CMakeLists.txt
@@ -7,3 +7,14 @@ mlir_target_link_libraries(mlir-irdl-to-cpp
   )
 
 setup_host_tool(mlir-irdl-to-cpp MLIR_IRDL_TO_CPP MLIR_IRDL_TO_CPP_EXE MLIR_IRDL_TO_CPP_TARGET)
+
+if(NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+  install(TARGETS mlir-irdl-to-cpp
+          RUNTIME DESTINATION "${MLIR_TOOLS_INSTALL_DIR}"
+          COMPONENT mlir-irdl-to-cpp)
+  if(NOT LLVM_ENABLE_IDE)
+    add_llvm_install_targets(install-mlir-irdl-to-cpp
+                             DEPENDS mlir-irdl-to-cpp
+                             COMPONENT mlir-irdl-to-cpp)
+  endif()
+endif()

diff  --git a/mlir/tools/mlir-src-sharder/CMakeLists.txt b/mlir/tools/mlir-src-sharder/CMakeLists.txt
index bc4a11bd4c0cb..b5d90cfe238ed 100644
--- a/mlir/tools/mlir-src-sharder/CMakeLists.txt
+++ b/mlir/tools/mlir-src-sharder/CMakeLists.txt
@@ -2,6 +2,8 @@ set(LLVM_LINK_COMPONENTS Support)
 set(LIBS MLIRSupport)
 
 add_tablegen(mlir-src-sharder MLIR_SRC_SHARDER
+  DESTINATION "${MLIR_TOOLS_INSTALL_DIR}"
+  EXPORT MLIR
   mlir-src-sharder.cpp)
 
 set_target_properties(mlir-src-sharder PROPERTIES FOLDER "MLIR/Tablegenning")


        


More information about the Mlir-commits mailing list