[MLIR][IRDL][CMake] CMake fixes for cross-compilation (#145672)

The PR fixes a misconfigured dependency that causes CMake error "No rule
to make target 'NATIVE/bin/mlir-irdl-to-cpp'" for cross-compilation.
This commit is contained in:
arthurqiu 2025-07-04 19:04:33 +08:00 committed by GitHub
parent 043789519a
commit 03cfba484f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,7 +5,7 @@ function(add_irdl_to_cpp_target target irdl_file)
# The command output depends on the executable to ensure IRDL sources are properly rebuilt
# if the tool changes.
DEPENDS ${MLIR_IRDL_TO_CPP_EXE} ${CMAKE_CURRENT_SOURCE_DIR}/${irdl_file}
DEPENDS ${MLIR_IRDL_TO_CPP_TARGET} ${MLIR_IRDL_TO_CPP_EXE} ${CMAKE_CURRENT_SOURCE_DIR}/${irdl_file}
COMMENT "Building ${irdl_file}..."
)
add_custom_target(${target} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${irdl_file}.cpp.inc)