Merge changes from topic "adbd_host"

* changes:
  Allowlist python dependency of adb targets
  bp2build support for host_ldlibs
This commit is contained in:
Treehugger Robot
2023-05-17 05:23:21 +00:00
committed by Gerrit Code Review
4 changed files with 62 additions and 12 deletions

View File

@@ -4663,3 +4663,49 @@ cc_library {
},
})
}
func TestCcLibraryHostLdLibs(t *testing.T) {
runCcLibraryTestCase(t, Bp2buildTestCase{
Description: "cc_binary linker flags for host_ldlibs",
ModuleTypeUnderTest: "cc_binary",
ModuleTypeUnderTestFactory: cc.BinaryFactory,
Blueprint: soongCcLibraryPreamble + `cc_binary {
name: "a",
host_supported: true,
ldflags: ["-lcommon"],
target: {
linux: {
host_ldlibs: [
"-llinux",
],
},
darwin: {
ldflags: ["-ldarwinadditional"],
host_ldlibs: [
"-ldarwin",
],
},
windows: {
host_ldlibs: [
"-lwindows",
],
},
},
}
`,
ExpectedBazelTargets: []string{
MakeBazelTargetNoRestrictions("cc_binary", "a", AttrNameToString{
"linkopts": `["-lcommon"] + select({
"//build/bazel/platforms/os:darwin": [
"-ldarwinadditional",
"-ldarwin",
],
"//build/bazel/platforms/os:linux_glibc": ["-llinux"],
"//build/bazel/platforms/os:windows": ["-lwindows"],
"//conditions:default": [],
})`,
"local_includes": `["."]`,
}),
},
})
}