Skip to content

Commit a8805d5

Browse files
committed
[mlir][python] normalize paths in AddMLIRPython.cmake
1 parent 11ba327 commit a8805d5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mlir/cmake/modules/AddMLIRPython.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ function(declare_mlir_python_extension name)
141141
# These properties support generator expressions and are automatically exported
142142
list(TRANSFORM ARG_SOURCES PREPEND "${ARG_ROOT_DIR}/" OUTPUT_VARIABLE _build_sources)
143143
list(TRANSFORM ARG_SOURCES PREPEND "${_install_destination}/" OUTPUT_VARIABLE _install_sources)
144+
145+
set(build_sources)
146+
foreach(s ${_build_sources})
147+
cmake_path(SET path NORMALIZE "${s}")
148+
list(APPEND build_sources ${path})
149+
endforeach()
150+
set(install_sources)
151+
foreach(s ${_install_sources})
152+
cmake_path(SET path NORMALIZE "${s}")
153+
list(APPEND install_sources ${path})
154+
endforeach()
155+
144156
target_sources(${name} INTERFACE
145157
"$<BUILD_INTERFACE:${_build_sources}>"
146158
"$<INSTALL_INTERFACE:${_install_sources}>"

0 commit comments

Comments
 (0)