Merge "bp2build: build //external/scudo/..." am: ccfd7fc939 am: 58344f0391 am: 1c7591cfb9

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1704771

Change-Id: I3665975d656141f7919cce5d80eff25ea7edc9d4
This commit is contained in:
Jingwen Chen 2021-05-13 13:23:04 +00:00 committed by Automerger Merge Worker
commit 8e27e6c226
3 changed files with 52 additions and 1 deletions

View File

@ -173,6 +173,7 @@ var (
"external/jemalloc_new": Bp2BuildDefaultTrueRecursively,
"external/fmtlib": Bp2BuildDefaultTrueRecursively,
"external/arm-optimized-routines": Bp2BuildDefaultTrueRecursively,
"external/scudo": Bp2BuildDefaultTrueRecursively,
}
// Per-module denylist to always opt modules out of both bp2build and mixed builds.

View File

@ -506,6 +506,56 @@ cc_library {
"header.h",
"-Ifoo/bar",
],
)`},
},
{
description: "cc_library cppflags goes into copts",
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `cc_library {
name: "a",
srcs: ["a.cpp"],
cflags: [
"-Wall",
],
cppflags: [
"-fsigned-char",
"-pedantic",
],
arch: {
arm64: {
cppflags: ["-DARM64=1"],
},
},
target: {
android: {
cppflags: ["-DANDROID=1"],
},
},
bazel_module: { bp2build_available: true },
}
`,
},
bp: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
copts = [
"-Wall",
"-fsigned-char",
"-pedantic",
"-Ifoo/bar",
] + select({
"//build/bazel/platforms/arch:arm64": ["-DARM64=1"],
"//conditions:default": [],
}) + select({
"//build/bazel/platforms/os:android": ["-DANDROID=1"],
"//conditions:default": [],
}),
srcs = ["a.cpp"],
)`},
},
}

View File

@ -190,7 +190,7 @@ func bp2BuildParseCompilerProps(ctx android.TopDownMutatorContext, module *Modul
// Parse the list of copts.
parseCopts := func(baseCompilerProps *BaseCompilerProperties) []string {
var copts []string
for _, flag := range baseCompilerProps.Cflags {
for _, flag := range append(baseCompilerProps.Cflags, baseCompilerProps.Cppflags...) {
// Soong's cflags can contain spaces, like `-include header.h`. For
// Bazel's copts, split them up to be compatible with the
// no_copts_tokenization feature.