1"""Macros to generate constraint settings and values for Soong variables.""" 2 3def soong_config_variables(bool_vars, value_vars, string_vars): 4 for variable in bool_vars.keys() + value_vars.keys(): 5 variable = variable.lower() 6 native.constraint_setting( 7 name = variable + "_constraint", 8 ) 9 native.constraint_value( 10 name = variable, 11 constraint_setting = variable + "_constraint", 12 ) 13 for variable, choices in string_vars.items(): 14 for choice in choices: 15 var_with_choice = (variable + "__" + choice).lower() 16 native.constraint_setting( 17 name = var_with_choice + "_constraint", 18 ) 19 native.constraint_value( 20 name = var_with_choice, 21 constraint_setting = var_with_choice + "_constraint", 22 ) 23