From 72d3993c9b058f04700dfeffb282661f983eaff3 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Fri, 8 Jul 2016 23:23:48 -0700 Subject: [PATCH] Stop exporting NDK prebuilt modules to Make Make isn't going to use any of these anytime soon. So hide them from make for now, and be sure to save the AndroidMk shared library dependencies before we convert them to NDK dependencies. And $(ACP) is no longer used by $(copy-file-to-target) Change-Id: I8f8f7d0177d31ba4206c0bc1f2ff952dce53b6b4 --- cc/androidmk.go | 2 +- cc/cc.go | 38 +++++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/cc/androidmk.go b/cc/androidmk.go index 95250a64d..5495e205b 100644 --- a/cc/androidmk.go +++ b/cc/androidmk.go @@ -106,7 +106,7 @@ func (object *objectLinker) AndroidMk(ret *android.AndroidMkData) { ret.Custom = func(w io.Writer, name, prefix string) error { out := ret.OutputFile.Path() - fmt.Fprintln(w, "\n$("+prefix+"OUT_INTERMEDIATE_LIBRARIES)/"+name+objectExtension+":", out.String(), "| $(ACP)") + fmt.Fprintln(w, "\n$("+prefix+"OUT_INTERMEDIATE_LIBRARIES)/"+name+objectExtension+":", out.String()) fmt.Fprintln(w, "\t$(copy-file-to-target)") return nil diff --git a/cc/cc.go b/cc/cc.go index 15b8cb721..a043d3158 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -820,22 +820,6 @@ func (c *Module) deps(ctx BaseModuleContext) Deps { deps.SharedLibs = lastUniqueElements(deps.SharedLibs) deps.LateSharedLibs = lastUniqueElements(deps.LateSharedLibs) - if ctx.sdk() { - version := "." + ctx.sdkVersion() - - rewriteNdkLibs := func(list []string) []string { - for i, entry := range list { - if inList(entry, ndkPrebuiltSharedLibraries) { - list[i] = "ndk_" + entry + version - } - } - return list - } - - deps.SharedLibs = rewriteNdkLibs(deps.SharedLibs) - deps.LateSharedLibs = rewriteNdkLibs(deps.LateSharedLibs) - } - for _, lib := range deps.ReexportSharedLibHeaders { if !inList(lib, deps.SharedLibs) { ctx.PropertyErrorf("export_shared_lib_headers", "Shared library not in shared_libs: '%s'", lib) @@ -868,7 +852,23 @@ func (c *Module) depsMutator(actx android.BottomUpMutatorContext) { deps := c.deps(ctx) - c.Properties.AndroidMkSharedLibs = deps.SharedLibs + c.Properties.AndroidMkSharedLibs = append([]string(nil), deps.SharedLibs...) + + if ctx.sdk() { + version := "." + ctx.sdkVersion() + + rewriteNdkLibs := func(list []string) []string { + for i, entry := range list { + if inList(entry, ndkPrebuiltSharedLibraries) { + list[i] = "ndk_" + entry + version + } + } + return list + } + + deps.SharedLibs = rewriteNdkLibs(deps.SharedLibs) + deps.LateSharedLibs = rewriteNdkLibs(deps.LateSharedLibs) + } actx.AddVariationDependencies([]blueprint.Variation{{"link", "static"}}, wholeStaticDepTag, deps.WholeStaticLibs...) @@ -2457,6 +2457,7 @@ func (*ndkPrebuiltObjectLinker) deps(ctx BaseModuleContext, deps Deps) Deps { func ndkPrebuiltObjectFactory() (blueprint.Module, []interface{}) { module := newBaseModule(android.DeviceSupported, android.MultilibBoth) module.linker = &ndkPrebuiltObjectLinker{} + module.Properties.HideFromMake = true return module.Init() } @@ -2491,6 +2492,7 @@ func ndkPrebuiltLibraryFactory() (blueprint.Module, []interface{}) { linker := &ndkPrebuiltLibraryLinker{} linker.dynamicProperties.BuildShared = true module.linker = linker + module.Properties.HideFromMake = true return module.Init() } @@ -2520,6 +2522,7 @@ func ndkPrebuiltSharedStlFactory() (blueprint.Module, []interface{}) { linker := &ndkPrebuiltStlLinker{} linker.dynamicProperties.BuildShared = true module.linker = linker + module.Properties.HideFromMake = true return module.Init() } @@ -2528,6 +2531,7 @@ func ndkPrebuiltStaticStlFactory() (blueprint.Module, []interface{}) { linker := &ndkPrebuiltStlLinker{} linker.dynamicProperties.BuildStatic = true module.linker = linker + module.Properties.HideFromMake = true return module.Init() }