https://reviews.llvm.org/D124075 causes MLIR to no longer build when using make rather than ninja, due to a tablegen-generated header being used before it is created. It seems that this is related to the use of LLVM_ENABLE_OBJLIB when using add_tablgen with a non-Ninja/Xcode generator. In that case an intermediate objlib target is generated. This patch fixes the issue by a) declaring dependencies in add_tablegen for mlir-pdll and b) making sure those dependencies are added to the objlib target. Differential Revision: https://reviews.llvm.org/D125010
See docs/CMake.html for instructions on how to build LLVM with CMake.