diff --git a/cc/cc.go b/cc/cc.go index eb7c639b3..a8011b842 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -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() {