blob: ce751954fbf9e72e81680827d5c1472bcde2205c [file] [log] [blame]
Serge Bazanski394b67e2023-07-19 17:34:34 +02001BuildKindProvider = provider(fields = ['type'])
2
3def _impl(ctx):
4 values = ['full', 'lite']
5 value = ctx.build_setting_value
6 if value not in values:
7 fail(str(ctx.label) + " build setting allowed to take values {full, lite} but was set to " + value)
8
9 return BuildKindProvider(type = value)
10
11buildkind = rule(
12 implementation = _impl,
13 build_setting = config.string(flag = True),
14 doc = """
15 Build kind for userspace tools, either full (will have a direct
16 dependency on data files) or lite (will not have a direct dependency on
17 data files and will not attempt to load them).
18 """,
19)