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
diff --git a/cc/cc.go b/cc/cc.go
index eb7c639..a8011b8 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -2335,9 +2335,11 @@
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 @@
}
// 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() {