Synchronizing multiple custom targets requires not only target but also
file dependencies. Building Linalg involves running yaml-gen followed by
tablegen. Currently, these custom targets are only synchronized using a
target dependency resulting in issues in specific incremental build
setups (https://llvm.discourse.group/t/missing-build-cmake-tblgen-dependency/3727/10).
This patch introduces a novel LLVM_TARGET_DEPENDS variable to the
TableGen.cmake file to provide a way to specify file dependencies.
Additionally, it adapts the Linalg CMakeLists.txt to introduce the
necessary file dependency between yaml-gen and tablegen.
Can you add a Todo that when this function is rewritten and the old tc parser is retired, to eliminate the parent scope manipulation and do the tablegen generation here in this scope?
I really don't like this action at a distance manipulation of something like a dependency. But since it is all in the same file, in an intermediate state, and I know you are getting ready to delete the old so this can be reworked, I'll favor submitting in this way to fix the incremental build issue.