Merge "convert cc_object crt property in bp2build"

This commit is contained in:
Treehugger Robot
2023-01-30 17:07:37 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ func TestCcObjectSimple(t *testing.T) {
exclude_srcs: ["a/b/exclude.c"],
sdk_version: "current",
min_sdk_version: "29",
crt: true,
}
`,
ExpectedBazelTargets: []string{
@@ -76,6 +77,7 @@ func TestCcObjectSimple(t *testing.T) {
"system_dynamic_deps": `[]`,
"sdk_version": `"current"`,
"min_sdk_version": `"29"`,
"crt": "True",
}),
},
})

View File

@@ -142,6 +142,7 @@ type bazelObjectAttributes struct {
Absolute_includes bazel.StringListAttribute
Stl *string
Linker_script bazel.LabelAttribute
Crt *bool
sdkAttributes
}
@@ -208,6 +209,7 @@ func objectBp2Build(ctx android.TopDownMutatorContext, m *Module) {
Absolute_includes: compilerAttrs.absoluteIncludes,
Stl: compilerAttrs.stl,
Linker_script: linkerScript,
Crt: m.linker.(*objectLinker).Properties.Crt,
sdkAttributes: bp2BuildParseSdkAttributes(m),
}