bp2build: split full_cc_library into shared/static
Test: mixed_droid.sh in conjunction with rule changes
Test: bp2build.sh
Change-Id: If0577065fd39a0446eab16b62c15204d43207e19
diff --git a/cc/cc.go b/cc/cc.go
index 113620c..aeb342f 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1713,7 +1713,15 @@
// Returns true if Bazel was successfully used for the analysis of this module.
func (c *Module) maybeGenerateBazelActions(actx android.ModuleContext) bool {
- bazelModuleLabel := c.GetBazelLabel(actx, c)
+ var bazelModuleLabel string
+ if actx.ModuleType() == "cc_library" && c.static() {
+ // cc_library is a special case in bp2build; two targets are generated -- one for each
+ // of the shared and static variants. The shared variant keeps the module name, but the
+ // static variant uses a different suffixed name.
+ bazelModuleLabel = bazelLabelForStaticModule(actx, c)
+ } else {
+ bazelModuleLabel = c.GetBazelLabel(actx, c)
+ }
bazelActionsUsed := false
// Mixed builds mode is disabled for modules outside of device OS.
// TODO(b/200841190): Support non-device OS in mixed builds.