-# 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.
DEPENDS ${${project}_TABLEGEN_TARGET} ${${project}_TABLEGEN_EXE}
${local_tds} ${global_tds}
${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
+ ${LLVM_TARGET_DEPENDS}
COMMENT "Building ${ofn}..."
)
${MLIR_LINALG_ODS_GEN_EXE}
${MLIR_LINALG_ODS_GEN_TARGET}
${GEN_ODS_FILE} ${GEN_CPP_FILE})
+ # Setup the file dependencies needed for the subsequent tablegen step.
+ # TODO: Once there is only one way of generating named ops remove this parent
+ # scope manipulation and implement the tablegen generation in the same scope.
+ 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
${MLIR_LINALG_ODS_YAML_GEN_EXE}
${MLIR_LINALG_ODS_YAML_GEN_TARGET}
${GEN_ODS_FILE} ${GEN_CPP_FILE})
+ # Setup the file dependencies needed for the subsequent tablegen step.
+ # TODO: Once there is only one way of generating named ops remove this parent
+ # scope manipulation and implement the tablegen generation in the same scope.
+ 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.
+# ported. At the same time, move the YAML and TableGen generation to the same
+# scope to avoid the at a distance dependency manipulation via
+# LLVM_TARGET_DEPENDS.
+set(LLVM_TARGET_DEPENDS "")
add_linalg_ods_tc_gen(LinalgNamedStructuredOpsSpec.tc LinalgNamedStructuredOps)
add_linalg_ods_yaml_gen(LinalgNamedStructuredOps.yaml LinalgNamedStructuredOps)