blob: 19c7cd10ac75625880f47e37856a6b6afb96e350 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# -*- Python -*-
"""Yocto rule for yocto compiler autoconfiguration."""
def _tpl(repository_ctx, tpl, substitutions={}, out=None):
if not out:
out = tpl
repository_ctx.template(
out,
Label("//third_party/toolchains/yocto:%s.tpl" % tpl),
substitutions)
def _yocto_compiler_configure_impl(repository_ctx):
_tpl(repository_ctx, "CROSSTOOL")
repository_ctx.symlink(repository_ctx.attr.build_file, "BUILD")
yocto_compiler_configure = repository_rule(
implementation = _yocto_compiler_configure_impl,
attrs = {
"remote_config_repo": attr.string(mandatory = False, default =""),
"build_file": attr.label(),
},
)
|