From 062103115cb7102c8ef665a1b936e6041a1ab463 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 10 Jun 2020 15:47:34 -0700 Subject: [PATCH] Add exclude_shared_libs, expand exclude_static_libs to cover static_libs Allow variants to exclude shared or static libs. Bug: 153609531 Test: manual Change-Id: I6ac9c445ed233c774a051743ed6760058c9918e9 --- cc/linker.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cc/linker.go b/cc/linker.go index 57a0c016a..c9cbd9baf 100644 --- a/cc/linker.go +++ b/cc/linker.go @@ -177,7 +177,10 @@ type BaseLinkerProperties struct { Version_script *string `android:"path,arch_variant"` // list of static libs that should not be used to build this module - Exclude_static_libs []string + Exclude_static_libs []string `android:"arch_variant"` + + // list of shared libs that should not be used to build this module + Exclude_shared_libs []string `android:"arch_variant"` } func NewBaseLinker(sanitize *sanitize) *baseLinker { @@ -223,6 +226,8 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { deps.ReexportSharedLibHeaders = append(deps.ReexportSharedLibHeaders, linker.Properties.Export_shared_lib_headers...) deps.ReexportGeneratedHeaders = append(deps.ReexportGeneratedHeaders, linker.Properties.Export_generated_headers...) + deps.SharedLibs = removeListFromList(deps.SharedLibs, linker.Properties.Exclude_shared_libs) + deps.StaticLibs = removeListFromList(deps.StaticLibs, linker.Properties.Exclude_static_libs) deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, linker.Properties.Exclude_static_libs) if Bool(linker.Properties.Use_version_lib) {