bp2build: refactor compiler/linker prop function.
This changes the return value into a compiler/linker attr struct to
standardize callsites and make it easier to retrieve the parsed attrs.
Test: TH
Change-Id: I1e3956e7cb5d924ce8472ece940faea459beef37
diff --git a/cc/object.go b/cc/object.go
index de45293..9bb279a 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -157,7 +157,7 @@
}
// Set arch-specific configurable attributes
- copts, srcs, hdrs := bp2BuildParseCompilerProps(ctx, m)
+ compilerAttrs := bp2BuildParseCompilerProps(ctx, m)
var localIncludeDirs []string
var asFlags []string
for _, props := range m.compiler.compilerProps() {
@@ -196,17 +196,11 @@
}
// TODO(b/183595872) warn/error if we're not handling product variables
- 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))
- }
- }
-
attrs := &bazelObjectAttributes{
- Srcs: srcs,
- Hdrs: hdrs,
+ Srcs: compilerAttrs.srcs,
+ Hdrs: compilerAttrs.hdrs,
Deps: deps,
- Copts: copts,
+ Copts: compilerAttrs.copts,
Asflags: asFlags,
Local_include_dirs: localIncludeDirs,
}