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
This commit is contained in:
Jingwen Chen
2021-04-09 10:43:12 +00:00
parent b4628eb03f
commit 107c0de80e
4 changed files with 53 additions and 41 deletions

View File

@@ -96,14 +96,14 @@ func CcLibraryHeadersBp2Build(ctx android.TopDownMutatorContext) {
}
exportedIncludes, exportedIncludesHeaders := bp2BuildParseExportedIncludes(ctx, module)
copts, _, _ := bp2BuildParseCompilerProps(ctx, module)
headerLibs, _ := bp2BuildParseLinkerProps(ctx, module)
compilerAttrs := bp2BuildParseCompilerProps(ctx, module)
linkerAttrs := bp2BuildParseLinkerProps(ctx, module)
attrs := &bazelCcLibraryHeadersAttributes{
Copts: copts,
Copts: compilerAttrs.copts,
Includes: exportedIncludes,
Hdrs: exportedIncludesHeaders,
Deps: headerLibs,
Deps: linkerAttrs.deps,
}
props := bazel.BazelTargetModuleProperties{