[Mlir-commits] [mlir] [MLIR] Normalize path separator in MLIRConfig.cmake (PR #208659)

Michael Kruse llvmlistbot at llvm.org
Mon Jul 13 05:44:02 PDT 2026


https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/208659

>From 6c136abba23ee01dfe44aab1e46214c2984c73fd Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Fri, 10 Jul 2026 10:12:22 +0200
Subject: [PATCH] [MLIR] Use TO_CMAKE_PATH

---
 mlir/cmake/modules/CMakeLists.txt | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/mlir/cmake/modules/CMakeLists.txt b/mlir/cmake/modules/CMakeLists.txt
index 47349f0c7eb62..e7d7d3a526b80 100644
--- a/mlir/cmake/modules/CMakeLists.txt
+++ b/mlir/cmake/modules/CMakeLists.txt
@@ -55,10 +55,12 @@ set(MLIR_CONFIG_INCLUDE_DIRS
   "${MLIR_SOURCE_DIR}/include"
   "${MLIR_BINARY_DIR}/include"
   )
-# Refer to the best host mlir-tblgen, which might be a host-optimized version
-set(MLIR_CONFIG_TABLEGEN_EXE "${MLIR_TABLEGEN_EXE}")
-set(MLIR_CONFIG_PDLL_TABLEGEN_EXE "${MLIR_PDLL_TABLEGEN_EXE}")
-set(MLIR_CONFIG_SRC_SHARDER_TABLEGEN_EXE "${MLIR_SRC_SHARDER_TABLEGEN_EXE}")
+# Refer to the best host mlir-tblgen, which might be a host-optimized version.
+# TO_CMAKE_PATH normalizes path separators across platforms. Backslashes would
+# cause a syntax error in MLIRConfig.cmake.
+file(TO_CMAKE_PATH "${MLIR_TABLEGEN_EXE}" MLIR_CONFIG_TABLEGEN_EXE)
+file(TO_CMAKE_PATH "${MLIR_PDLL_TABLEGEN_EXE}" MLIR_CONFIG_PDLL_TABLEGEN_EXE)
+file(TO_CMAKE_PATH "${MLIR_SRC_SHARDER_TABLEGEN_EXE}" MLIR_CONFIG_SRC_SHARDER_TABLEGEN_EXE)
 
 configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/MLIRConfig.cmake.in



More information about the Mlir-commits mailing list