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
|
from devtools.yamaker.modules import join_srcs
from devtools.yamaker.project import NixProject
def ragel6_post_install(self):
m = self.yamakes["."]
m.prebuilt = "build/prebuilt/contrib/tools/ragel6/ya.make.prebuilt"
# Rename ragel to ragel6.
m.PROGRAM = ["ragel6"]
# aapl in ragel 5 and 6 is the same.
m.PEERDIR += ["contrib/tools/ragel5/aapl"]
# Join sources to reduce compilation utime.
srcs = m.SRCS
m.SRCS = {src for src in srcs if src.startswith("rl")}
srcs -= m.SRCS
for prefix in "cd", "cs", "fs", "go", "ml", "r":
group = {src for src in srcs if src.startswith(prefix)}
srcs -= group
m.after("SRCS", join_srcs(f"all_{prefix}.cpp", group))
m.after("SRCS", join_srcs("all_other.cpp", srcs))
ragel6 = NixProject(
owners=["pg", "g:cpp-contrib"],
arcdir="contrib/tools/ragel6",
nixattr="ragel",
install_subdir="ragel",
copy_sources=["*.rl", "*.kl", "*.kh"],
post_install=ragel6_post_install,
)
|