Add target/os configurable string_list attrs.
Starting with copts for cc_object, with an extracted function that can be shared with other cc_* module types. Test: TH Change-Id: I9025232e83a3dcd0ca243387486fafbdbd3e2d9b
This commit is contained in:
@@ -156,13 +156,11 @@ func ObjectBp2Build(ctx android.TopDownMutatorContext) {
|
||||
}
|
||||
|
||||
// Set arch-specific configurable attributes
|
||||
var copts bazel.StringListAttribute
|
||||
var srcs bazel.LabelListAttribute
|
||||
var localIncludeDirs []string
|
||||
var asFlags []string
|
||||
for _, props := range m.compiler.compilerProps() {
|
||||
if baseCompilerProps, ok := props.(*BaseCompilerProperties); ok {
|
||||
copts.Value = baseCompilerProps.Cflags
|
||||
srcs = bazel.MakeLabelListAttribute(
|
||||
android.BazelLabelForModuleSrcExcludes(
|
||||
ctx,
|
||||
@@ -205,14 +203,13 @@ func ObjectBp2Build(ctx android.TopDownMutatorContext) {
|
||||
for arch, p := range m.GetArchProperties(&BaseCompilerProperties{}) {
|
||||
if cProps, ok := p.(*BaseCompilerProperties); ok {
|
||||
srcs.SetValueForArch(arch.Name, android.BazelLabelForModuleSrcExcludes(ctx, cProps.Srcs, cProps.Exclude_srcs))
|
||||
copts.SetValueForArch(arch.Name, cProps.Cflags)
|
||||
}
|
||||
}
|
||||
|
||||
attrs := &bazelObjectAttributes{
|
||||
Srcs: srcs,
|
||||
Deps: deps,
|
||||
Copts: copts,
|
||||
Copts: bp2BuildParseCflags(ctx, m),
|
||||
Asflags: asFlags,
|
||||
Local_include_dirs: localIncludeDirs,
|
||||
}
|
||||
|
Reference in New Issue
Block a user