aboutsummaryrefslogtreecommitdiff
path: root/cc/image.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2020-12-16 16:46:01 -0800
committerColin Cross <ccross@android.com>2020-12-21 17:53:30 -0800
commit127bb8b9f6e0c224bb9240464b86f9db4e83ba83 (patch)
tree3c97897d90ff230a9e67e4b3202ed38cb8e3587b /cc/image.go
parentadc81a07836e0ed16c70a7fe20e5726b60ecb613 (diff)
downloadsoong-127bb8b9f6e0c224bb9240464b86f9db4e83ba83.tar.gz
Don't rewrite LLNDK dependencies with .llndk suffix
Rewriting LLNDK dependencies with .llndk suffix requries referencing a global data structure to determine if a given library is an LLNDK library and therefore needs the .llndk suffix. References to global data structures from mutators must be removed to support incremental Soong analysis. Instead, move the LLNDK stubs rules into the vendor variant of the implementing cc_library so that the original name can be used. As an incremental step, the llndk_library modules are left in place, and the properties are copied into the cc_library via the dependency specified by the llndk_stub property. A followup will move the LLNDK properties directly into the cc_library and delete the llndk_library modules. The global list of LLNDK libraries is kept for now as it is used to generate the vndk.libraries.txt file. Bug: 170784825 Test: m checkbuild Test: compare Soong outputs Test: all Soong tests Change-Id: I2a942b21c162541a49e27b2e5833c9aebccff1d0
Diffstat (limited to 'cc/image.go')
-rw-r--r--cc/image.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/cc/image.go b/cc/image.go
index cca454aa9..380c1dbe1 100644
--- a/cc/image.go
+++ b/cc/image.go
@@ -308,6 +308,18 @@ 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