Add missing mlir-headers target and add tablegen'd deps to it.
authorStella Laurenzo <laurenzo@google.com>
Wed, 1 Jan 2020 00:32:41 +0000 (16:32 -0800)
committerStella Laurenzo <laurenzo@google.com>
Sat, 4 Jan 2020 00:04:40 +0000 (16:04 -0800)
Summary:
Prior to this, "ninja install-mlir-headers" failed with an error indicating
the missing target. Verified that from a clean build, the installed
headers include generated files.

Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, llvm-commits

Tags: #llvm

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

mlir/CMakeLists.txt

index a81221a..be76e8d 100644 (file)
@@ -17,6 +17,7 @@ function(add_mlir_dialect dialect dialect_doc_filename)
   mlir_tablegen(${dialect}.h.inc -gen-op-decls)
   mlir_tablegen(${dialect}.cpp.inc -gen-op-defs)
   add_public_tablegen_target(MLIR${dialect}IncGen)
+  add_dependencies(mlir-headers MLIR${dialect}IncGen)
 
   # Generate Dialect Documentation
   set(LLVM_TARGET_DEFINITIONS ${dialect_doc_filename}.td)
@@ -32,6 +33,10 @@ function(add_mlir_dialect dialect dialect_doc_filename)
   add_dependencies(mlir-doc ${dialect_doc_filename}DocGen)
 endfunction()
 
+# Installing the headers and docs needs to depend on generating any public
+# tablegen'd targets.
+add_custom_target(mlir-headers)
+set_target_properties(mlir-headers PROPERTIES FOLDER "Misc")
 add_custom_target(mlir-doc)
 
 # TODO: This is to handle the current static registration, but should be