From a46de707758fc360f9860ef96502dcda883b769c Mon Sep 17 00:00:00 2001 From: Bill Peckham Date: Tue, 21 Apr 2020 17:23:37 -0700 Subject: [PATCH] Propagate Soong header_libs to module-info.json Adding the Soong header_libs dependencies to module-info.json allows tools to more accurately detect all module-level dependencies. This change adds LOCAL_HEADER_LIBRARIES, populated from header_libs, to the Soong's Android.mk prebulit module definition so that it will propagate through the prebuilt into base_rules.mk and eventually to module-info.json. Bug: 151755703 Test: Find header_libs deps in module-info.json Change-Id: Ic7134d33fa71822aae548ca097851dc0c1371bad --- cc/androidmk.go | 3 +++ cc/cc.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/cc/androidmk.go b/cc/androidmk.go index 5438b149d..671adb55f 100644 --- a/cc/androidmk.go +++ b/cc/androidmk.go @@ -92,6 +92,9 @@ func (c *Module) AndroidMkEntries() []android.AndroidMkEntries { if len(c.Properties.AndroidMkWholeStaticLibs) > 0 { entries.AddStrings("LOCAL_WHOLE_STATIC_LIBRARIES", c.Properties.AndroidMkWholeStaticLibs...) } + if len(c.Properties.AndroidMkHeaderLibs) > 0 { + entries.AddStrings("LOCAL_HEADER_LIBRARIES", c.Properties.AndroidMkHeaderLibs...) + } entries.SetString("LOCAL_SOONG_LINK_TYPE", c.makeLinkType) if c.UseVndk() { entries.SetBool("LOCAL_USE_VNDK", true) diff --git a/cc/cc.go b/cc/cc.go index 66425c7de..082816ef2 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -223,6 +223,7 @@ type BaseProperties struct { AndroidMkStaticLibs []string `blueprint:"mutated"` AndroidMkRuntimeLibs []string `blueprint:"mutated"` AndroidMkWholeStaticLibs []string `blueprint:"mutated"` + AndroidMkHeaderLibs []string `blueprint:"mutated"` HideFromMake bool `blueprint:"mutated"` PreventInstall bool `blueprint:"mutated"` ApexesProvidingSharedLibs []string `blueprint:"mutated"` @@ -2606,6 +2607,9 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps { case wholeStaticDepTag: c.Properties.AndroidMkWholeStaticLibs = append( c.Properties.AndroidMkWholeStaticLibs, makeLibName(depName)) + case headerDepTag: + c.Properties.AndroidMkHeaderLibs = append( + c.Properties.AndroidMkHeaderLibs, makeLibName(depName)) } })