[Mlir-commits] [mlir] [mlir][python] normalize paths in AddMLIRPython.cmake (PR #74675)

Maksim Levental llvmlistbot at llvm.org
Wed Dec 6 15:16:14 PST 2023


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

None

>From a8805d59002a6b1ab2a296190d4ea48d599d6415 Mon Sep 17 00:00:00 2001
From: max <maksim.levental at gmail.com>
Date: Wed, 6 Dec 2023 17:14:26 -0600
Subject: [PATCH] [mlir][python] normalize paths in AddMLIRPython.cmake

---
 mlir/cmake/modules/AddMLIRPython.cmake | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/mlir/cmake/modules/AddMLIRPython.cmake b/mlir/cmake/modules/AddMLIRPython.cmake
index 012380603a4c45..007cb497b6e7d6 100644
--- a/mlir/cmake/modules/AddMLIRPython.cmake
+++ b/mlir/cmake/modules/AddMLIRPython.cmake
@@ -141,6 +141,18 @@ function(declare_mlir_python_extension name)
   # These properties support generator expressions and are automatically exported
   list(TRANSFORM ARG_SOURCES PREPEND "${ARG_ROOT_DIR}/" OUTPUT_VARIABLE _build_sources)
   list(TRANSFORM ARG_SOURCES PREPEND "${_install_destination}/" OUTPUT_VARIABLE _install_sources)
+
+  set(build_sources)
+  foreach(s ${_build_sources})
+    cmake_path(SET path NORMALIZE "${s}")
+    list(APPEND build_sources ${path})
+  endforeach()
+  set(install_sources)
+  foreach(s ${_install_sources})
+    cmake_path(SET path NORMALIZE "${s}")
+    list(APPEND install_sources ${path})
+  endforeach()
+
   target_sources(${name} INTERFACE
     "$<BUILD_INTERFACE:${_build_sources}>"
     "$<INSTALL_INTERFACE:${_install_sources}>"



More information about the Mlir-commits mailing list