Define product_available property
To make a module available to product variants, it must define
`product_available: true`. `vendor_available: true` will not create
product variants any more.
However, in this CL, we don't change the behavior of
`vendor_available` property. It still creates both variants. After we
update all Android.bp files that need to provide product variants
with `product_available: true`, we may upload the remaining patches.
Bug: 150902910
Test: lunch aosp_arm64-userdebug && m
Change-Id: I0fd5be7bbae2c45d5cab3c3c2ca49f53a9b6f975
diff --git a/cc/linker.go b/cc/linker.go
index 7f13e28..cbf8898 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -96,32 +96,32 @@
Runtime_libs []string `android:"arch_variant"`
Target struct {
- Vendor struct {
- // list of shared libs that only should be used to build the vendor
- // variant of the C/C++ module.
+ Vendor, Product struct {
+ // list of shared libs that only should be used to build vendor or
+ // product variant of the C/C++ module.
Shared_libs []string
- // list of static libs that only should be used to build the vendor
- // variant of the C/C++ module.
+ // list of static libs that only should be used to build vendor or
+ // product variant of the C/C++ module.
Static_libs []string
- // list of shared libs that should not be used to build the vendor variant
- // of the C/C++ module.
+ // list of shared libs that should not be used to build vendor or
+ // product variant of the C/C++ module.
Exclude_shared_libs []string
- // list of static libs that should not be used to build the vendor variant
- // of the C/C++ module.
+ // list of static libs that should not be used to build vendor or
+ // product variant of the C/C++ module.
Exclude_static_libs []string
- // list of header libs that should not be used to build the vendor variant
- // of the C/C++ module.
+ // list of header libs that should not be used to build vendor or
+ // product variant of the C/C++ module.
Exclude_header_libs []string
- // list of runtime libs that should not be installed along with the vendor
- // variant of the C/C++ module.
+ // list of runtime libs that should not be installed along with
+ // vendor or variant of the C/C++ module.
Exclude_runtime_libs []string
- // version script for this vendor variant
+ // version script for vendor or product variant
Version_script *string `android:"arch_variant"`
}
Recovery struct {
@@ -243,6 +243,7 @@
deps.WholeStaticLibs = append(deps.WholeStaticLibs, "libbuildversion")
}
+ // TODO(b/150902910): product variant must use Target.Product
if ctx.useVndk() {
deps.SharedLibs = append(deps.SharedLibs, linker.Properties.Target.Vendor.Shared_libs...)
deps.SharedLibs = removeListFromList(deps.SharedLibs, linker.Properties.Target.Vendor.Exclude_shared_libs)
@@ -479,6 +480,7 @@
versionScript := ctx.ExpandOptionalSource(
linker.Properties.Version_script, "version_script")
+ // TODO(b/150902910): product variant must use Target.Product
if ctx.useVndk() && linker.Properties.Target.Vendor.Version_script != nil {
versionScript = ctx.ExpandOptionalSource(
linker.Properties.Target.Vendor.Version_script,