[Mlir-commits] [mlir] [MLIR][IRDL][CMake] CMake fixes for cross-compilation (PR #145672)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Jul 1 00:55:10 PDT 2025


arthurqiu wrote:

> Have you checked the comment above? Can you make sure that it still correctly rebuilds the sources if the tool changes? If this is not the case you may want to depend on both the target and the executable.

Not sure if I miss anything, but I think IRDL source should still be rebuilt if it depends on `MLIR_IRDL_TO_CPP_TARGET`.

https://cmake.org/cmake/help/latest/command/add_custom_command.html
> If the argument is the name of a target (created by the [add_custom_target()](https://cmake.org/cmake/help/latest/command/add_custom_target.html#command:add_custom_target), [add_executable()](https://cmake.org/cmake/help/latest/command/add_executable.html#command:add_executable), or [add_library()](https://cmake.org/cmake/help/latest/command/add_library.html#command:add_library) command) a target-level dependency is created to make sure the target is built before any target using this custom command. **Additionally, if the target is an executable or library, a file-level dependency is created to cause the custom command to re-run whenever the target is recompiled.**

https://github.com/llvm/llvm-project/pull/145672


More information about the Mlir-commits mailing list