Skip to content

Commit eac1e13

Browse files
authored
[bzl][mlir][emitc] Add build targets for EmitC C-API/Python bindings (#119610)
Added by 3c464d2
1 parent 87d2aec commit eac1e13

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,24 @@ mlir_c_api_cc_library(
529529
],
530530
)
531531

532+
mlir_c_api_cc_library(
533+
name = "CAPIEmitC",
534+
srcs = [
535+
"lib/CAPI/Dialect/EmitC.cpp",
536+
],
537+
hdrs = ["include/mlir-c/Dialect/EmitC.h"],
538+
capi_deps = [
539+
":CAPIIR",
540+
],
541+
header_deps = [
542+
":EmitCPassIncGen",
543+
],
544+
includes = ["include"],
545+
deps = [
546+
":EmitCDialect",
547+
],
548+
)
549+
532550
mlir_c_api_cc_library(
533551
name = "CAPILinalg",
534552
srcs = [

utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,36 @@ filegroup(
539539
],
540540
)
541541

542+
##---------------------------------------------------------------------------##
543+
# EmitC dialect.
544+
##---------------------------------------------------------------------------##
545+
546+
gentbl_filegroup(
547+
name = "EmitCPyGen",
548+
tbl_outs = [
549+
(
550+
[
551+
"-gen-python-op-bindings",
552+
"-bind-dialect=emitc",
553+
],
554+
"mlir/dialects/_emitc_ops_gen.py",
555+
),
556+
],
557+
tblgen = "//mlir:mlir-tblgen",
558+
td_file = "mlir/dialects/EmitC.td",
559+
deps = [
560+
"//mlir:EmitCTdFiles",
561+
],
562+
)
563+
564+
filegroup(
565+
name = "EmitCPyFiles",
566+
srcs = [
567+
"mlir/dialects/emitc.py",
568+
":EmitCPyGen",
569+
],
570+
)
571+
542572
##---------------------------------------------------------------------------##
543573
# Index dialect.
544574
##---------------------------------------------------------------------------##

0 commit comments

Comments
 (0)