Add defaults target for shared linking
Add a defaults target that all targets linking to aconfig codegen with
the new storage API dependencies will need. The target takes the new
storage APIs conditionally behind a flag, so we can disable it easily.
In this topic, we add it to a single target to see that it builds and
adds the dependency. In follow-on CLs we can add it to the rest of the
targets.
Test: m audiopolicy_tests
Bug: 347701310
Change-Id: I67643205b283301f72c5466401060212b637388f
Merged-In: I67643205b283301f72c5466401060212b637388f
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index 8ce8855..146479c 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -512,3 +512,4 @@
$(call inherit-product,$(SRC_TARGET_DIR)/product/updatable_apex.mk)
$(call soong_config_set, bionic, large_system_property_node, $(RELEASE_LARGE_SYSTEM_PROPERTY_NODE))
+$(call soong_config_set, Aconfig, read_from_new_storage, $(RELEASE_READ_FROM_NEW_STORAGE))
diff --git a/tools/aconfig/aconfig_storage_read_api/Android.bp b/tools/aconfig/aconfig_storage_read_api/Android.bp
index 3b124b1..5e9eb54 100644
--- a/tools/aconfig/aconfig_storage_read_api/Android.bp
+++ b/tools/aconfig/aconfig_storage_read_api/Android.bp
@@ -104,6 +104,33 @@
afdo: true,
}
+soong_config_module_type {
+ name: "aconfig_lib_cc_shared_link_defaults",
+ module_type: "cc_defaults",
+ config_namespace: "Aconfig",
+ bool_variables: [
+ "read_from_new_storage",
+ ],
+ properties: [
+ "shared_libs",
+ ],
+}
+
+soong_config_bool_variable {
+ name: "read_from_new_storage",
+}
+
+aconfig_lib_cc_shared_link_defaults {
+ name: "aconfig_lib_cc_shared_link.defaults",
+ soong_config_variables: {
+ read_from_new_storage: {
+ shared_libs: [
+ "libaconfig_storage_read_api_cc",
+ ],
+ },
+ },
+}
+
cc_defaults {
name: "aconfig_lib_cc_static_link.defaults",
shared_libs: [