blob: dbebca23556b6e3a955d01f36c77a9947895d1f8 [file] [log] [blame]
Tim Windelschmidt156248b2025-01-10 00:27:45 +01001BuildKindInfo = provider(
2 "Build kind for userspace tools",
3 fields = ["type"],
4)
Serge Bazanski394b67e2023-07-19 17:34:34 +02005
6def _impl(ctx):
Tim Windelschmidt156248b2025-01-10 00:27:45 +01007 values = ["full", "lite"]
Serge Bazanski394b67e2023-07-19 17:34:34 +02008 value = ctx.build_setting_value
9 if value not in values:
10 fail(str(ctx.label) + " build setting allowed to take values {full, lite} but was set to " + value)
11
Tim Windelschmidt156248b2025-01-10 00:27:45 +010012 return BuildKindInfo(type = value)
Serge Bazanski394b67e2023-07-19 17:34:34 +020013
14buildkind = rule(
15 implementation = _impl,
16 build_setting = config.string(flag = True),
17 doc = """
18 Build kind for userspace tools, either full (will have a direct
19 dependency on data files) or lite (will not have a direct dependency on
20 data files and will not attempt to load them).
21 """,
22)