From aa1ce0385c358994bbeb7a05ba352da5ab65180e Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Mon, 22 Apr 2024 14:52:23 +0900 Subject: [PATCH] Add more comments about soong config variables Bug: 329208946 Test: N/A Change-Id: I68a5e59bc095f5c23509993675f26ed903bcbc78 --- README.md | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 42fecb4d4..140822b70 100644 --- a/README.md +++ b/README.md @@ -463,18 +463,32 @@ soong_config_string_variable { This example describes a new `acme_cc_defaults` module type that extends the `cc_defaults` module type, with four additional conditionals based on variables `board`, `feature`, `impl` and `width` which can affect properties `cflags` and -`srcs`. Additionally, each conditional will contain a `conditions_default` -property can affect `cflags` and `srcs` in the following conditions: +`srcs`. The four types of soong variables control properties in the following +ways. -* bool variable (e.g. `feature`): the variable is unspecified or not set to a true value +* bool variable (e.g. `feature`): Properties are applied if set to `true`. +* list variable (e.g. `impl`): (lists of strings properties only) Properties are + applied for each value in the list, using `%s` substitution. For example, if + the property is `["%s.cpp", "%s.h"]` and the list value is `foo bar`, + the result is `["foo.cpp", "foo.h", "bar.cpp", "bar.h"]`. +* value variable (e.g. `width`): (strings or lists of strings) The value are + directly substituted into properties using `%s`. +* string variable (e.g. `board`): Properties are applied only if they match the + variable's value. + +Additionally, each conditional containing a `conditions_default` property can +affect `cflags` and `srcs` in the following conditions: + +* bool variable (e.g. `feature`): the variable is unspecified or not set to + `true` * list variable (e.g. `impl`): the variable is unspecified * value variable (e.g. `width`): the variable is unspecified -* string variable (e.g. `board`): the variable is unspecified or the variable is set to a string unused in the -given module. For example, with `board`, if the `board` -conditional contains the properties `soc_a` and `conditions_default`, when -board=soc_b, the `cflags` and `srcs` values under `conditions_default` will be -used. To specify that no properties should be amended for `soc_b`, you can set -`soc_b: {},`. +* string variable (e.g. `board`): the variable is unspecified or the variable is + set to a string unused in the given module. For example, with `board`, if the + `board` conditional contains the properties `soc_a` and `conditions_default`, + when `board` is `soc_b`, the `cflags` and `srcs` values under + `conditions_default` is used. To specify that no properties should be amended + for `soc_b`, you can set `soc_b: {},`. The values of the variables can be set from a product's `BoardConfig.mk` file: ```