Create LLNDK vendor variants when DeviceVndkVersion is not set
The LLNDK vendor variants need to exist even when the VNDK is not being used in order for the next patch to list them once the global maps are removed. Bug: 176904285 Test: m checkbuild Change-Id: Ib29ede455d5b6a4b7d3f4685db8fba6d32025314
This commit is contained in:
59
cc/image.go
59
cc/image.go
@@ -282,31 +282,34 @@ func (m *Module) ImageMutatorBegin(mctx android.BaseModuleContext) {
|
||||
productVndkVersion = platformVndkVersion
|
||||
}
|
||||
|
||||
if boardVndkVersion == "" {
|
||||
_, isLLNDKLibrary := m.linker.(*llndkStubDecorator)
|
||||
_, isLLNDKHeaders := m.linker.(*llndkHeadersDecorator)
|
||||
lib := moduleLibraryInterface(m)
|
||||
hasLLNDKStubs := lib != nil && lib.hasLLNDKStubs()
|
||||
|
||||
if isLLNDKLibrary || isLLNDKHeaders || hasLLNDKStubs {
|
||||
// This is an LLNDK library. The implementation of the library will be on /system,
|
||||
// and vendor and product variants will be created with LLNDK stubs.
|
||||
// The LLNDK libraries need vendor variants even if there is no VNDK.
|
||||
// The obsolete llndk_library and llndk_headers modules also need the vendor variants
|
||||
// so the cc_library LLNDK stubs can depend on them.
|
||||
if hasLLNDKStubs {
|
||||
coreVariantNeeded = true
|
||||
}
|
||||
if platformVndkVersion != "" {
|
||||
vendorVariants = append(vendorVariants, platformVndkVersion)
|
||||
productVariants = append(productVariants, platformVndkVersion)
|
||||
}
|
||||
if boardVndkVersion != "" {
|
||||
vendorVariants = append(vendorVariants, boardVndkVersion)
|
||||
}
|
||||
if productVndkVersion != "" {
|
||||
productVariants = append(productVariants, productVndkVersion)
|
||||
}
|
||||
} else if boardVndkVersion == "" {
|
||||
// If the device isn't compiling against the VNDK, we always
|
||||
// use the core mode.
|
||||
coreVariantNeeded = true
|
||||
} else if _, ok := m.linker.(*llndkStubDecorator); ok {
|
||||
// LL-NDK stubs only exist in the vendor and product variants,
|
||||
// since the real libraries will be used in the core variant.
|
||||
vendorVariants = append(vendorVariants,
|
||||
platformVndkVersion,
|
||||
boardVndkVersion,
|
||||
)
|
||||
productVariants = append(productVariants,
|
||||
platformVndkVersion,
|
||||
productVndkVersion,
|
||||
)
|
||||
} else if _, ok := m.linker.(*llndkHeadersDecorator); ok {
|
||||
// ... and LL-NDK headers as well
|
||||
vendorVariants = append(vendorVariants,
|
||||
platformVndkVersion,
|
||||
boardVndkVersion,
|
||||
)
|
||||
productVariants = append(productVariants,
|
||||
platformVndkVersion,
|
||||
productVndkVersion,
|
||||
)
|
||||
} else if m.isSnapshotPrebuilt() {
|
||||
// Make vendor variants only for the versions in BOARD_VNDK_VERSION and
|
||||
// PRODUCT_EXTRA_VNDK_VERSIONS.
|
||||
@@ -364,18 +367,6 @@ func (m *Module) ImageMutatorBegin(mctx android.BaseModuleContext) {
|
||||
} else {
|
||||
vendorVariants = append(vendorVariants, platformVndkVersion)
|
||||
}
|
||||
} else if lib := moduleLibraryInterface(m); lib != nil && lib.hasLLNDKStubs() {
|
||||
// This is an LLNDK library. The implementation of the library will be on /system,
|
||||
// and vendor and product variants will be created with LLNDK stubs.
|
||||
coreVariantNeeded = true
|
||||
vendorVariants = append(vendorVariants,
|
||||
platformVndkVersion,
|
||||
boardVndkVersion,
|
||||
)
|
||||
productVariants = append(productVariants,
|
||||
platformVndkVersion,
|
||||
productVndkVersion,
|
||||
)
|
||||
} else {
|
||||
// This is either in /system (or similar: /data), or is a
|
||||
// modules built with the NDK. Modules built with the NDK
|
||||
|
Reference in New Issue
Block a user