Add variant_prepend support for all the properties in bp2build
This is a follow up of aosp/2336916. All the properties that have
variant_prepend tag are supported in bp2build.
Bug: 261644490
Test: TH and modified tests with updated expected behaviors
Change-Id: I13bb5d4d8fcd38bf153fa9083c9c945aec2dfa19
diff --git a/cc/object.go b/cc/object.go
index c3a198d..6cb1a30 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -78,7 +78,7 @@
Static_libs []string `android:"arch_variant,variant_prepend"`
// list of shared library modules should only provide headers for this module.
- Shared_libs []string `android:"arch_variant"`
+ Shared_libs []string `android:"arch_variant,variant_prepend"`
// list of modules that should only provide headers for this module.
Header_libs []string `android:"arch_variant,variant_prepend"`
@@ -178,6 +178,8 @@
deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Static_libs))
deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Shared_libs))
deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Header_libs))
+ // static_libs, shared_libs, and header_libs have variant_prepend tag
+ deps.Prepend = true
}
}
}