[MLIR] Fix dependencies for Analysis libraries
authorStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Tue, 12 May 2020 20:37:31 +0000 (13:37 -0700)
committerStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Tue, 12 May 2020 20:41:16 +0000 (13:41 -0700)
cmake does not truly support dependencies on automatically generated files
which are not in the same directory as the targets which depend on them.
It works with ninja, but doesn't work with make

This patch adds an explicit dependence so that all dialects are built
before the analysis libraries.

Differential Revision: https://reviews.llvm.org/D79805

mlir/lib/Analysis/CMakeLists.txt

index a008bcd..0d9cc90 100644 (file)
@@ -17,6 +17,9 @@ add_mlir_library(MLIRAnalysis
   ADDITIONAL_HEADER_DIRS
   ${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis
 
+  DEPENDS
+  mlir-headers
+
   LINK_LIBS PUBLIC
   MLIRAffineOps
   MLIRCallInterfaces
@@ -35,6 +38,9 @@ add_mlir_library(MLIRLoopAnalysis
   ADDITIONAL_HEADER_DIRS
   ${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis
 
+  DEPENDS
+  mlir-headers
+
   LINK_LIBS PUBLIC
   MLIRAffineOps
   MLIRCallInterfaces