Merge "Handle product_variable asflag for cc_object."

This commit is contained in:
Liz Kammer
2021-03-31 18:43:55 +00:00
committed by Gerrit Code Review
5 changed files with 134 additions and 1 deletions

View File

@@ -206,6 +206,34 @@ cc_object {
srcs = [
"a/b/c.c",
],
)`,
},
},
{
description: "cc_object with product variable",
moduleTypeUnderTest: "cc_object",
moduleTypeUnderTestFactory: cc.ObjectFactory,
moduleTypeUnderTestBp2BuildMutator: cc.ObjectBp2Build,
blueprint: `cc_object {
name: "foo",
include_build_directory: false,
product_variables: {
platform_sdk_version: {
asflags: ["-DPLATFORM_SDK_VERSION=%d"],
},
},
bazel_module: { bp2build_available: true },
}
`,
expectedBazelTargets: []string{`cc_object(
name = "foo",
asflags = [
"-DPLATFORM_SDK_VERSION={Platform_sdk_version}",
],
copts = [
"-fno-addrsig",
],
)`,
},
},