Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3ad53c4 authored by Cole Faust's avatar Cole Faust
Browse files

Add soong_config_set_string_list

To type a soong config variable as a string list for use in selects.

Bug: 375341427
Test: m nothing --no-skip-soong-tests
Change-Id: I8d0683c144e00225779428374246d234cbb4f850
parent dc9587a9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -330,6 +330,18 @@ $(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(filter true,$3))
$(eval SOONG_CONFIG_TYPE_$(strip $1)_$(strip $2):=bool)
endef

# soong_config_set_string_list is the same as soong_config_set, but it will
# also type the variable as a list of strings, so that when using select() expressions
# in blueprint files they can use list values instead of strings.
# The values of the list must be space-separated.
# $1 is the namespace. $2 is the variable name. $3 is the variable value.
# Ex: $(call soong_config_set_string_list,acme,COOL_LIBS,a b)
define soong_config_set_string_list
$(call soong_config_define_internal,$1,$2) \
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(strip $3))
$(eval SOONG_CONFIG_TYPE_$(strip $1)_$(strip $2):=string_list)
endef

# soong_config_append appends to the value of the variable in the given Soong
# config namespace. If the variable does not exist, it will be defined. If the
# namespace does not  exist, it will be defined.