Merge "Dedupe libraries in both static and whole static"

This commit is contained in:
Treehugger Robot
2022-03-26 00:32:01 +00:00
committed by Gerrit Code Review
2 changed files with 13 additions and 6 deletions

View File

@@ -283,8 +283,8 @@ cc_library {
srcs: ["both.cpp"],
cflags: ["bothflag"],
shared_libs: ["shared_dep_for_both"],
static_libs: ["static_dep_for_both"],
whole_static_libs: ["whole_static_lib_for_both"],
static_libs: ["static_dep_for_both", "whole_and_static_lib_for_both"],
whole_static_libs: ["whole_static_lib_for_both", "whole_and_static_lib_for_both"],
static: {
srcs: ["staticonly.cpp"],
cflags: ["staticflag"],
@@ -332,6 +332,11 @@ cc_library_static {
bazel_module: { bp2build_available: false },
}
cc_library_static {
name: "whole_and_static_lib_for_both",
bazel_module: { bp2build_available: false },
}
cc_library {
name: "shared_dep_for_shared",
bazel_module: { bp2build_available: false },
@@ -367,6 +372,7 @@ cc_library {
]`,
"whole_archive_deps": `[
":whole_static_lib_for_both",
":whole_and_static_lib_for_both",
":whole_static_lib_for_static",
]`}),
makeBazelTarget("cc_library_shared", "a", attrNameToString{
@@ -388,6 +394,7 @@ cc_library {
]`,
"whole_archive_deps": `[
":whole_static_lib_for_both",
":whole_and_static_lib_for_both",
":whole_static_lib_for_shared",
]`,
}),