Merge "Add variant_prepend support for all the properties in bp2build"

This commit is contained in:
Zi Wang
2023-01-10 05:54:29 +00:00
committed by Gerrit Code Review
6 changed files with 29 additions and 11 deletions

View File

@@ -804,6 +804,12 @@ func bp2BuildParseBaseProps(ctx android.Bp2buildMutatorContext, module *Module)
(&linkerAttrs).wholeArchiveDeps.Add(bp2buildCcSysprop(ctx, module.Name(), module.Properties.Min_sdk_version, compilerAttrs.syspropSrcs))
}
linkerAttrs.wholeArchiveDeps.Prepend = true
linkerAttrs.deps.Prepend = true
compilerAttrs.localIncludes.Prepend = true
compilerAttrs.absoluteIncludes.Prepend = true
compilerAttrs.hdrs.Prepend = true
features := compilerAttrs.features.Clone().Append(linkerAttrs.features).Append(bp2buildSanitizerFeatures(ctx, module))
features.DeduplicateAxesFromBase()

View File

@@ -78,7 +78,7 @@ type ObjectLinkerProperties struct {
Static_libs []string `android:"arch_variant,variant_prepend"`
// list of shared library modules should only provide headers for this module.
Shared_libs []string `android:"arch_variant"`
Shared_libs []string `android:"arch_variant,variant_prepend"`
// list of modules that should only provide headers for this module.
Header_libs []string `android:"arch_variant,variant_prepend"`
@@ -178,6 +178,8 @@ func objectBp2Build(ctx android.TopDownMutatorContext, m *Module) {
deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Static_libs))
deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Shared_libs))
deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Header_libs))
// static_libs, shared_libs, and header_libs have variant_prepend tag
deps.Prepend = true
}
}
}