diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake --- a/llvm/cmake/modules/TableGen.cmake +++ b/llvm/cmake/modules/TableGen.cmake @@ -1,4 +1,5 @@ -# LLVM_TARGET_DEFINITIONS must contain the name of the .td file to process. +# LLVM_TARGET_DEFINITIONS must contain the name of the .td file to process, +# while LLVM_TARGET_DEPENDS may contain additional file dependencies. # Extra parameters for `tblgen' may come after `ofn' parameter. # Adds the name of the generated file to TABLEGEN_OUTPUT. @@ -104,6 +105,7 @@ DEPENDS ${${project}_TABLEGEN_TARGET} ${${project}_TABLEGEN_EXE} ${local_tds} ${global_tds} ${LLVM_TARGET_DEFINITIONS_ABSOLUTE} + ${LLVM_TARGET_DEPENDS} COMMENT "Building ${ofn}..." ) diff --git a/mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt b/mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt --- a/mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt +++ b/mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt @@ -25,6 +25,7 @@ ${MLIR_LINALG_ODS_GEN_EXE} ${MLIR_LINALG_ODS_GEN_TARGET} ${GEN_ODS_FILE} ${GEN_CPP_FILE}) + set(LLVM_TARGET_DEPENDS ${LLVM_TARGET_DEPENDS} ${GEN_ODS_FILE} PARENT_SCOPE) endfunction() # Declare a function to generate ODS with mlir-linalg-ods-yaml-gen @@ -52,10 +53,12 @@ ${MLIR_LINALG_ODS_YAML_GEN_EXE} ${MLIR_LINALG_ODS_YAML_GEN_TARGET} ${GEN_ODS_FILE} ${GEN_CPP_FILE}) + set(LLVM_TARGET_DEPENDS ${LLVM_TARGET_DEPENDS} ${GEN_ODS_FILE} PARENT_SCOPE) endfunction() # TODO: Delete tc generation and replace with the YAML variant once all ops are # ported. +set(LLVM_TARGET_DEPENDS "") add_linalg_ods_tc_gen(LinalgNamedStructuredOpsSpec.tc LinalgNamedStructuredOps) add_linalg_ods_yaml_gen(LinalgNamedStructuredOps.yaml LinalgNamedStructuredOps)