Replace with stubs only for Android non-native-bridge targets

Host tools and native-bridge targets should be built on top of original
module rather than stubs. This change updates DepsMutator not to replace
to API surface stubs if target is not Android or target is
native-bridge.

Bug: N/A
Test: CF vendor build succeeded
Change-Id: I97eb98d9e63dcf15632468aa32211a14d48986a0
This commit is contained in:
Kiyoung Kim
2022-10-19 19:20:57 +09:00
parent 1227abee34
commit 11d9108cc7

View File

@@ -2335,9 +2335,11 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
ctx.ctx = ctx
deps := c.deps(ctx)
apiImportInfo := GetApiImports(c, actx)
deps = updateDepsWithApiImports(deps, apiImportInfo)
if ctx.Os() == android.Android && c.Target().NativeBridge != android.NativeBridgeEnabled {
deps = updateDepsWithApiImports(deps, apiImportInfo)
}
c.Properties.AndroidMkSystemSharedLibs = deps.SystemSharedLibs
@@ -2362,7 +2364,9 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
}
// Check header lib replacement from API surface first, and then check again with VSDK
lib = GetReplaceModuleName(lib, apiImportInfo.HeaderLibs)
if ctx.Os() == android.Android && c.Target().NativeBridge != android.NativeBridgeEnabled {
lib = GetReplaceModuleName(lib, apiImportInfo.HeaderLibs)
}
lib = GetReplaceModuleName(lib, GetSnapshot(c, &snapshotInfo, actx).HeaderLibs)
if c.isNDKStubLibrary() {