-
Notifications
You must be signed in to change notification settings - Fork 0
/
toolchain.bzl
27 lines (25 loc) · 928 Bytes
/
toolchain.bzl
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
GHDLInfo = provider(
doc = "Information about how to invoke the ghdl compiler.",
fields = ["ghdl_bin", "docker", "wrapper", "ghdl_deps", "c_compiler"],
)
def _ghdl_toolchain_impl(ctx):
toolchain_info = platform_common.ToolchainInfo(
ghdlinfo = GHDLInfo(
ghdl_bin = ctx.attr.ghdl_bin,
docker = ctx.attr.docker,
wrapper = ctx.attr.wrapper,
ghdl_deps = ctx.attr.ghdl_deps,
c_compiler = ctx.attr.c_compiler,
),
)
return [toolchain_info]
ghdl_toolchain = rule(
implementation = _ghdl_toolchain_impl,
attrs = {
"ghdl_bin": attr.label(default="@ghdl_toolchain//:ghdl_bin"),
"docker": attr.string(),
"wrapper": attr.label(default="@rules_ghdl//src:default_ghdl"),
"ghdl_deps": attr.label(default="@ghdl_toolchain//:ghdl_deps"),
"c_compiler": attr.string(default="/usr/bin/clang"),
},
)