Add exclude_header_libs for vendor_available:true libs
Adding a mechanism to conditionally exclude some header library
dependencies when a lib is built for vendors.
Without this, some libraries cannot be earily marked as vendor_available
if they are depending on header libs can shouldn't be marked as
vendor_available.
By using exclude_header_libs with exclude_srcs (or __ANDROID_VNDK__
macro), we can eliminate the unnecessary dependency for vendors.
Bug: 112338314
Test: build
Change-Id: If12dceb6045099fe828fe33af2ac4428f88499a2
diff --git a/cc/linker.go b/cc/linker.go
index 2972006..3620f59 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -103,6 +103,10 @@
// 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.
+ Exclude_header_libs []string
+
// list of runtime libs that should not be installed along with the vendor
// variant of the C/C++ module.
Exclude_runtime_libs []string
@@ -190,6 +194,7 @@
deps.SharedLibs = removeListFromList(deps.SharedLibs, linker.Properties.Target.Vendor.Exclude_shared_libs)
deps.ReexportSharedLibHeaders = removeListFromList(deps.ReexportSharedLibHeaders, linker.Properties.Target.Vendor.Exclude_shared_libs)
deps.StaticLibs = removeListFromList(deps.StaticLibs, linker.Properties.Target.Vendor.Exclude_static_libs)
+ deps.HeaderLibs = removeListFromList(deps.HeaderLibs, linker.Properties.Target.Vendor.Exclude_header_libs)
deps.ReexportStaticLibHeaders = removeListFromList(deps.ReexportStaticLibHeaders, linker.Properties.Target.Vendor.Exclude_static_libs)
deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, linker.Properties.Target.Vendor.Exclude_static_libs)
deps.RuntimeLibs = removeListFromList(deps.RuntimeLibs, linker.Properties.Target.Vendor.Exclude_runtime_libs)