diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -5,6 +5,7 @@ # Description: # The MLIR "Multi-Level Intermediate Representation" Compiler Infrastructure +load("@bazel_skylib//rules:expand_template.bzl", "expand_template") load("@bazel_skylib//rules:write_file.bzl", "write_file") load(":tblgen.bzl", "gentbl_cc_library", "td_library") load(":linalggen.bzl", "genlinalg") @@ -28,6 +29,23 @@ "utils/textmate/mlir.json", ]) +expand_template( + name = "mlir_config_h_gen", + out = "include/mlir/Config/mlir-config.h", + substitutions = { + "#cmakedefine01 MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS": "#define MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS 1" + }, + template = "include/mlir/Config/mlir-config.h.cmake", + visibility = ["//visibility:private"], +) + +cc_library( + name = "config", + hdrs = [ + "include/mlir/Config/mlir-config.h", + ], +) + filegroup( name = "c_headers", srcs = glob(["include/mlir-c/**/*"]), # <== i.e. match the entire tree @@ -5992,6 +6010,7 @@ ), includes = ["include"], deps = [ + ":config", ":ControlFlowInterfaces", ":IR", ":LoopLikeInterface",