blob: 3b2419663886203db0d66796e37ffde5e7c10f2a [file] [log] [blame]
"""Macros to generate constraint settings and values for Soong variables."""
def soong_config_variables(bool_vars, value_vars, string_vars):
for variable in bool_vars.keys() + value_vars.keys():
variable = variable.lower()
native.constraint_setting(
name = variable + "_constraint",
)
native.constraint_value(
name = variable,
constraint_setting = variable + "_constraint",
)
for variable, choices in string_vars.items():
for choice in choices:
var_with_choice = (variable + "__" + choice).lower()
native.constraint_setting(
name = var_with_choice + "_constraint",
)
native.constraint_value(
name = var_with_choice,
constraint_setting = var_with_choice + "_constraint",
)