-
Notifications
You must be signed in to change notification settings - Fork 891
Expand file tree
/
Copy path.bant-macros
More file actions
82 lines (75 loc) · 1.74 KB
/
.bant-macros
File metadata and controls
82 lines (75 loc) · 1.74 KB
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
# -*- Python -*-
# https://github.com/hzeller/bant#macros
#
# Tell bant (that is not looking at *.bzl files) how custom rules behave, just
# enough for it to see through them to provide features such as dwyu.
#
# To print a rule and apply the macro transformations, use the `-m` option
# to bant. e.g.
# bant print //src/gui:gui_qt -m
#
# If bant is not installed locally, use
# $(etc/get-bant-path.sh) //src/gui:gui_qt -m
#
# File can be formatted using regular buildifier.
python_wrap_cc = genrule(
name = name,
outs = [
out, # if defined
name + ".cc",
module + ".py",
],
)
tcl_wrap_cc = genrule(
name = name,
outs = [
out, # if defined
runtime_header, # if defined
name + ".cc",
],
)
tcl_encode = genrule(
name = name,
outs = [
out,
name + ".cc",
],
)
tcl_encode_sta = genrule(
name = name,
outs = [
out,
name + ".cc",
],
)
# gist extracted from @qt-bazel//:build_defs.bzl
qt6_library = (
[
genrule(
name = uisrc.rsplit("/", 1)[0].replace("/", "_") + "_ui_" + uisrc.rsplit("/", 1)[1][0:-3],
srcs = [uisrc],
outs = [uisrc.rsplit("/", 1)[0] + "/ui_" + uisrc.rsplit("/", 1)[1][0:-3] + ".h"],
)
for uisrc in uic_srcs
],
cc_library(
name = name,
srcs = srcs,
hdrs = hdrs + moc_hdrs + [
uisrc.rsplit("/", 1)[0] + "/ui_" + uisrc.rsplit("/", 1)[1][0:-3] + ".h"
for uisrc in uic_srcs
],
includes = includes,
deps = deps,
),
)
genlex = genrule(
name = name,
srcs = [src],
outs = [out],
)
genyacc = genrule(
name = name,
srcs = [src],
outs = [header_out, source_out] + extra_outs,
)