Add cc_library.target.vendor.no_stubs
This is to handle libz special case. libz has stubs but not an LLNDK.
So, libz.vendor should be treated as non-stub-providing libraries and
Vendor APEX should bundle it if it's used by its contents.
libz will set no_stubs for vendor/product variants.
Bug: 313806237
Test: go tests ./apex/...
Change-Id: I10759d7073838909126f8bfe87654f11aa02fd32
diff --git a/cc/image.go b/cc/image.go
index 239f1db..4f36111 100644
--- a/cc/image.go
+++ b/cc/image.go
@@ -23,6 +23,8 @@
"android/soong/android"
"android/soong/snapshot"
+
+ "github.com/google/blueprint/proptools"
)
var _ android.ImageInterface = (*Module)(nil)
@@ -622,6 +624,10 @@
lib.baseCompiler.Properties.Exclude_generated_sources = append(lib.baseCompiler.Properties.Exclude_generated_sources,
lib.baseCompiler.Properties.Target.Vendor.Exclude_generated_sources...)
+
+ if lib.Properties.Target.Vendor.No_stubs {
+ proptools.Clear(&lib.Properties.Stubs)
+ }
}
}
@@ -635,6 +641,10 @@
lib.baseCompiler.Properties.Exclude_generated_sources = append(lib.baseCompiler.Properties.Exclude_generated_sources,
lib.baseCompiler.Properties.Target.Product.Exclude_generated_sources...)
+
+ if lib.Properties.Target.Product.No_stubs {
+ proptools.Clear(&lib.Properties.Stubs)
+ }
}
}