Replace soong config module types with selects
select statements are a new syntax for conditionals in bp files
that require less boilerplate and expose the opportunity for
configuring the modules two different ways in a single build.
See go/soong-selects for more information.
Flag: EXEMPT refactor
Bug: 342006386
Test: Presubmits
Change-Id: I6f9e27224c239702764101025fe6ed1f2c93b46a
diff --git a/hostapd/Android.bp b/hostapd/Android.bp
index 8a7dacf..36b9bf1 100644
--- a/hostapd/Android.bp
+++ b/hostapd/Android.bp
@@ -66,37 +66,8 @@
],
}
-soong_config_module_type {
- name: "hostapd_cflags_cc_defaults",
- module_type: "cc_defaults",
- config_namespace: "hostapd",
- value_variables: [
- "platform_version",
- "nl80211_driver",
- ],
- properties: ["cflags"],
-}
-
-hostapd_cflags_cc_defaults {
+cc_defaults {
name: "hostapd_cflags_defaults",
- soong_config_variables: {
- // Devices that include this module should set these soong config vars appropriately.
- // For example:
- // $(call add_soong_config_namespace, wpa_supplicant)
- // $(call add_soong_config_var_value, wpa_supplicant, platform_version, $(PLATFORM_VERSION))
- // $(call add_soong_config_var_value, wpa_supplicant, nl80211_driver, CONFIG_DRIVER_NL80211_QCA)
- platform_version: {
- cflags: ["-DVERSION_STR_POSTFIX=\"-%s\""],
- conditions_default: {
- // Default value
- cflags: ["-DVERSION_STR_POSTFIX=\"-Android\""],
- },
- },
- nl80211_driver: {
- cflags: ["-D%s"],
- // Flag is optional, so no default value provided.
- },
- },
// Generated by building hostapd and printing LOCAL_CFLAGS.
cflags: [
"-DWPA_IGNORE_CONFIG_ERRORS",
@@ -166,7 +137,21 @@
"-Wno-unused-parameter",
"-Wno-unused-variable",
"-Wno-macro-redefined",
- ],
+ ] +
+ // Devices that include this module should set these soong config vars appropriately.
+ // For example:
+ // $(call soong_config_set, hostapd, platform_version, $(PLATFORM_VERSION))
+ // $(call soong_config_set, hostapd, nl80211_driver, CONFIG_DRIVER_NL80211_QCA)
+ select(soong_config_variable("hostapd", "platform_version"), {
+ any @ version: ["-DVERSION_STR_POSTFIX=\"-" + version + "\""],
+ default: ["-DVERSION_STR_POSTFIX=\"-Android\""],
+ }) +
+ select(soong_config_variable("hostapd", "nl80211_driver"), {
+ any @ driver: ["-D" + driver],
+ // Flag is optional, so no default value provided.
+ default: [],
+ }),
+
// Similar to suppressing clang compiler warnings, here we
// suppress clang-tidy warnings to reduce noises in Android build.log.
tidy_checks: [