Soong generates libraries.txt files for vndk
These files were generated by Make. This is an effort to converting make
to soong.
These files are created under a known location: $SOONG_OUT_DIR/vndk
- llndk.libraries.txt
- vndksp.libraries.txt
- vndkcore.libraries.txt
- vndkprivate.libraries.txt
- vndkcorevariant.libraries.txt
- vndk.libraries.txt: merged all of above with tags
The last one is used by 'check-vndk-list'.
(See the topic)
Others will be packaged by VNDK APEX of current VNDK.
(This is not merged yet. After landing, a follow-up CL will be
followed.)
Bug: 141019581
Bug: 141450808
Test: m check-vndk-list
Change-Id: I9a24f6975bd4b226a94f61a13d43857dcdce6b88
diff --git a/cc/cc.go b/cc/cc.go
index 806a6ed..57f5ab8 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -215,6 +215,10 @@
// Allows this module to use non-APEX version of libraries. Useful
// for building binaries that are started before APEXes are activated.
Bootstrap *bool
+
+ // Even if DeviceConfig().VndkUseCoreVariant() is set, this module must use vendor variant.
+ // see soong/cc/config/vndk.go
+ MustUseVendorVariant bool `blueprint:"mutated"`
}
type VendorProperties struct {
@@ -586,7 +590,7 @@
func (c *Module) isLlndk(config android.Config) bool {
// Returns true for both LLNDK (public) and LLNDK-private libs.
- return inList(c.Name(), *llndkLibraries(config))
+ return inList(c.BaseModuleName(), *llndkLibraries(config))
}
func (c *Module) isLlndkPublic(config android.Config) bool {
@@ -596,7 +600,7 @@
func (c *Module) isVndkPrivate(config android.Config) bool {
// Returns true for LLNDK-private, VNDK-SP-private, and VNDK-core-private.
- return inList(c.Name(), *vndkPrivateLibraries(config))
+ return inList(c.BaseModuleName(), *vndkPrivateLibraries(config))
}
func (c *Module) isVndk() bool {
@@ -639,7 +643,7 @@
}
func (c *Module) mustUseVendorVariant() bool {
- return c.isVndkSp() || inList(c.Name(), config.VndkMustUseVendorVariantList)
+ return c.isVndkSp() || c.Properties.MustUseVendorVariant
}
func (c *Module) getVndkExtendsModuleName() string {
@@ -2113,7 +2117,6 @@
}
func (c *Module) getMakeLinkType(actx android.ModuleContext) string {
- name := actx.ModuleName()
if c.useVndk() {
if lib, ok := c.linker.(*llndkStubDecorator); ok {
if Bool(lib.Properties.Vendor_available) {
@@ -2135,7 +2138,7 @@
// TODO(b/114741097): use the correct ndk stl once build errors have been fixed
//family, link := getNdkStlFamilyAndLinkType(c)
//return fmt.Sprintf("native:ndk:%s:%s", family, link)
- } else if inList(name, *vndkUsingCoreVariantLibraries(actx.Config())) {
+ } else if actx.DeviceConfig().VndkUseCoreVariant() && !c.mustUseVendorVariant() {
return "native:platform_vndk"
} else {
return "native:platform"