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
diff --git a/cc/object.go b/cc/object.go
index ea8d7d3..4f8797d 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -156,13 +156,11 @@
}
// 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 @@
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,
}