Replace device_kernel_headers with generated_kernel_headers

* For inline kernel building
* Avoids having to make edits to multiple repos, even
  if it's a quick replacement

Change-Id: I01d4a9b3e24315731efbc8d16882818d20e38e89
This commit is contained in:
Chirayu Desai 2021-01-30 20:08:32 +05:30 committed by Bartłomiej Rudecki
parent f563943c6b
commit e8a02794af

View file

@ -2468,6 +2468,21 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
variantNdkLibs := []string{}
variantLateNdkLibs := []string{}
if ctx.Os() == android.Android {
rewriteHeaderLibs := func(list []string) (newHeaderLibs []string) {
newHeaderLibs = []string{}
for _, entry := range list {
// Replace device_kernel_headers with generated_kernel_headers
// for inline kernel building
if entry == "device_kernel_headers" {
newHeaderLibs = append(newHeaderLibs, "generated_kernel_headers")
continue
}
newHeaderLibs = append(newHeaderLibs, entry)
}
return newHeaderLibs
}
deps.HeaderLibs = rewriteHeaderLibs(deps.HeaderLibs)
deps.SharedLibs, variantNdkLibs = FilterNdkLibs(c, ctx.Config(), deps.SharedLibs)
deps.LateSharedLibs, variantLateNdkLibs = FilterNdkLibs(c, ctx.Config(), deps.LateSharedLibs)
deps.ReexportSharedLibHeaders, _ = FilterNdkLibs(c, ctx.Config(), deps.ReexportSharedLibHeaders)