-
Notifications
You must be signed in to change notification settings - Fork 25
/
BUILD.jinja
126 lines (121 loc) · 3.94 KB
/
BUILD.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# {{ dialect_name }} dialect implementation
package(
default_applicable_licenses = ["@heir//:license"],
default_visibility = ["//visibility:public"],
)
cc_library(
name = "Dialect",
srcs = [
"{{ dialect_name }}Dialect.cpp",
],
hdrs = [
{% if enable_attributes %}
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Attributes.h",
{% endif %}
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Dialect.h",
{% if enable_ops %}
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Ops.h",
{% endif %}
{% if enable_types %}
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Types.h",
{% endif %}
],
deps = [
{% if enable_attributes %}
":{{ dialect_name }}Attributes",
{% endif %}
{% if enable_ops %}
":{{ dialect_name }}Ops",
{% endif %}
{% if enable_types %}
":{{ dialect_name }}Types",
{% endif %}
{% if enable_attributes %}
"@heir//include/Dialect/{{ dialect_name }}/IR:attributes_inc_gen",
{% endif %}
"@heir//include/Dialect/{{ dialect_name }}/IR:dialect_inc_gen",
{% if enable_ops %}
"@heir//include/Dialect/{{ dialect_name }}/IR:ops_inc_gen",
{% endif %}
{% if enable_types %}
"@heir//include/Dialect/{{ dialect_name }}/IR:types_inc_gen",
{% endif %}
"@llvm-project//llvm:Support",
"@llvm-project//mlir:IR",
],
)
{% if enable_attributes %}
cc_library(
name = "{{ dialect_name }}Attributes",
srcs = [
"{{ dialect_name }}Attributes.cpp",
],
hdrs = [
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Attributes.h",
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Dialect.h",
],
deps = [
":{{ dialect_name }}",
{% if enable_attributes %}
"@heir//include/Dialect/{{ dialect_name }}/IR:attributes_inc_gen",
{% endif %}
"@heir//include/Dialect/{{ dialect_name }}/IR:dialect_inc_gen",
"@llvm-project//mlir:IR",
],
)
{% endif %}
{% if enable_types %}
cc_library(
name = "{{ dialect_name }}Types",
srcs = [
"{{ dialect_name }}Types.cpp",
],
hdrs = [
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Dialect.h",
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Types.h",
{% if enable_attributes %}
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Attributes.h",
{% endif %}
],
deps = [
{% if enable_attributes %}
":{{ dialect_name }}Attributes",
{% endif %}
"@heir//include/Dialect/{{ dialect_name }}/IR:dialect_inc_gen",
{% if enable_ops %}
"@heir//include/Dialect/{{ dialect_name }}/IR:ops_inc_gen",
{% endif %}
"@heir//include/Dialect/{{ dialect_name }}/IR:types_inc_gen",
"@llvm-project//mlir:IR",
],
)
{% endif %}
{% if enable_ops %}
cc_library(
name = "{{ dialect_name }}Ops",
srcs = [
"{{ dialect_name }}Ops.cpp",
],
hdrs = [
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Dialect.h",
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Ops.h",
{% if enable_types %}
"@heir//include/Dialect/{{ dialect_name }}/IR:{{ dialect_name }}Types.h",
{% endif %}
],
deps = [
{% if enable_attributes %}
":{{ dialect_name }}Attributes",
{% endif %}
{% if enable_types %}
":{{ dialect_name }}Types",
{% endif %}
"@heir//include/Dialect/{{ dialect_name }}/IR:dialect_inc_gen",
"@heir//include/Dialect/{{ dialect_name }}/IR:ops_inc_gen",
{% if enable_types %}
"@heir//include/Dialect/{{ dialect_name }}/IR:types_inc_gen",
{% endif %}
"@llvm-project//mlir:IR",
],
)
{% endif %}