Remove global state from vendor public libraries
Remove the global list of vendor public library modules used to rewrite
dependencies from the vendor module to the stubs for system modules,
and replace it with building the stubs directly in the system variant
of the vendor module.
Bug: 178231622
Test: vendor_public_library_test.go
Change-Id: I826e69ffd507d7e85fa3d4d85b5157428c642143
diff --git a/cc/makevars.go b/cc/makevars.go
index 923472a..fa0b2cc 100644
--- a/cc/makevars.go
+++ b/cc/makevars.go
@@ -71,8 +71,6 @@
}
func makeVarsProvider(ctx android.MakeVarsContext) {
- vendorPublicLibraries := vendorPublicLibraries(ctx.Config())
-
ctx.Strict("LLVM_RELEASE_VERSION", "${config.ClangShortVersion}")
ctx.Strict("LLVM_PREBUILTS_VERSION", "${config.ClangVersion}")
ctx.Strict("LLVM_PREBUILTS_BASE", "${config.ClangBase}")
@@ -106,7 +104,7 @@
ctx.VisitAllModules(func(module android.Module) {
if ccModule, ok := module.(*Module); ok {
baseName := ccModule.BaseModuleName()
- if inList(baseName, *vendorPublicLibraries) && module.ExportedToMake() {
+ if ccModule.IsVendorPublicLibrary() && module.ExportedToMake() {
if !inList(baseName, exportedVendorPublicLibraries) {
exportedVendorPublicLibraries = append(exportedVendorPublicLibraries, baseName)
}