diff --git a/mlir/cmake/modules/AddMLIR.cmake b/mlir/cmake/modules/AddMLIR.cmake --- a/mlir/cmake/modules/AddMLIR.cmake +++ b/mlir/cmake/modules/AddMLIR.cmake @@ -53,10 +53,12 @@ function(add_mlir_dialect_library name) set_property(GLOBAL APPEND PROPERTY MLIR_DIALECT_LIBS ${name}) add_llvm_library(${ARGV}) + add_dependencies(${name} mlir-headers) endfunction(add_mlir_dialect_library) # Declare the library associated with a conversion. function(add_mlir_conversion_library name) set_property(GLOBAL APPEND PROPERTY MLIR_CONVERSION_LIBS ${name}) add_llvm_library(${ARGV}) + add_dependencies(${name} mlir-headers) endfunction(add_mlir_conversion_library)