aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSasha Smundak <asmundak@google.com>2021-08-20 11:08:41 -0700
committerSasha Smundak <asmundak@google.com>2021-08-20 11:18:32 -0700
commit4a94bb884ace0c35eec6de93bc3cd422f3190b8f (patch)
tree9ae23a3af0101495df1bf52fc8902b1b13b0ce31
parent23d5ae4f6f1090be121aecf51b953da2fef35ae2 (diff)
downloadbuild-4a94bb884ace0c35eec6de93bc3cd422f3190b8f.tar.gz
Fix add_soong_config_namespace/add_soong_config_var macros
They were failing with an argument containing whitespace. That is, calling `$(call add_soong_config_namespace, foo)` would result in the attempt to assign to an empty variable. It went unnoticed because `ckati` silently ignores such an assignment (`make` is more diligent and fails). Bug: 190051051 Test: treehugger Change-Id: Ifcc168eaf2db725e705887889e732bcd4410db39
-rw-r--r--core/config.mk6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/config.mk b/core/config.mk
index acdf15e3b1..94235d9989 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -259,7 +259,7 @@ SOONG_CONFIG_NAMESPACES :=
define add_soong_config_namespace
$(eval SOONG_CONFIG_NAMESPACES += $1) \
-$(eval SOONG_CONFIG_$1 :=)
+$(eval SOONG_CONFIG_$(strip $1) :=)
endef
# The add_soong_config_var function adds a a list of soong config variables to
@@ -268,8 +268,8 @@ endef
# $1 is the namespace. $2 is the list of variables.
# Ex: $(call add_soong_config_var,acme,COOL_FEATURE_A COOL_FEATURE_B)
define add_soong_config_var
-$(eval SOONG_CONFIG_$1 += $2) \
-$(foreach v,$2,$(eval SOONG_CONFIG_$1_$v := $($v)))
+$(eval SOONG_CONFIG_$(strip $1) += $2) \
+$(foreach v,$(strip $2),$(eval SOONG_CONFIG_$(strip $1)_$v := $($v)))
endef
# The add_soong_config_var_value function defines a make variable and also adds