Extend add_soong_config_var to support variable list

Bug: b/149049342
Test: Supply list, inspect $(OUT)/soong/soong.variables
Change-Id: I905229441e392f6190bea6ae2169b0ecd1743d45
This commit is contained in:
Bill Peckham 2020-02-06 15:27:59 -08:00
parent 24e2f7c0f1
commit 62f5a4711e
1 changed files with 5 additions and 6 deletions

View File

@ -238,15 +238,14 @@ $(eval SOONG_CONFIG_NAMESPACES += $1) \
$(eval SOONG_CONFIG_$1 :=) $(eval SOONG_CONFIG_$1 :=)
endef endef
# The add_soong_config_var function adds a soong config variable to # The add_soong_config_var function adds a a list of soong config variables to
# SOONG_CONFIG_*. The variable and its value are then be available to a # SOONG_CONFIG_*. The variables and their values are then available to a
# soong_config_module_type in an Android.bp file. # soong_config_module_type in an Android.bp file.
# $1 is the namespace. $2 is the variable name. # $1 is the namespace. $2 is the list of variables.
# Ex: $(call add_soong_config_var,acme,COOL_FEATURE) # Ex: $(call add_soong_config_var,acme,COOL_FEATURE_A COOL_FEATURE_B)
define add_soong_config_var define add_soong_config_var
$(eval SOONG_CONFIG_$1 += $2) \ $(eval SOONG_CONFIG_$1 += $2) \
$(eval SOONG_CONFIG_$1_$2 := $($2)) $(foreach v,$2,$(eval SOONG_CONFIG_$1_$v := $($v)))
endef endef
# The add_soong_config_var_value function defines a make variable and also adds # The add_soong_config_var_value function defines a make variable and also adds