Skip to content

Commit 0e5031d

Browse files
Abseil Teamcopybara-github
authored andcommitted
Add helper libraries for absl/extend
PiperOrigin-RevId: 863363038 Change-Id: If6845e9711d39cee83f166291eb86720ba9ca5b7
1 parent b2f60a1 commit 0e5031d

16 files changed

Lines changed: 3850 additions & 0 deletions

CMake/AbseilDll.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ set(ABSL_INTERNAL_DLL_FILES
153153
"debugging/internal/utf8_for_code_point.h"
154154
"debugging/internal/vdso_support.cc"
155155
"debugging/internal/vdso_support.h"
156+
"extend/internal/aggregate.h"
157+
"extend/internal/dependencies.h"
158+
"extend/internal/is_tuple_hashable.h"
159+
"extend/internal/num_bases.h"
160+
"extend/internal/num_initializers.h"
161+
"extend/internal/reflection.cc"
162+
"extend/internal/reflection.h"
163+
"extend/internal/tuple.h"
156164
"functional/any_invocable.h"
157165
"functional/internal/front_binder.h"
158166
"functional/bind_front.h"

absl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ add_subdirectory(cleanup)
2020
add_subdirectory(container)
2121
add_subdirectory(crc)
2222
add_subdirectory(debugging)
23+
add_subdirectory(extend)
2324
add_subdirectory(flags)
2425
add_subdirectory(functional)
2526
add_subdirectory(hash)

absl/extend/CMakeLists.txt

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Copyright 2026 The Abseil Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
absl_cc_library(
16+
NAME
17+
dependencies_internal
18+
HDRS
19+
"internal/dependencies.h"
20+
COPTS
21+
${ABSL_DEFAULT_COPTS}
22+
)
23+
24+
absl_cc_test(
25+
NAME
26+
dependencies_internal_test
27+
SRCS
28+
"internal/dependencies_test.cc"
29+
COPTS
30+
${ABSL_TEST_COPTS}
31+
DEPS
32+
absl::dependencies_internal
33+
GTest::gmock_main
34+
)
35+
36+
absl_cc_library(
37+
NAME
38+
num_initializers_internal
39+
HDRS
40+
"internal/num_initializers.h"
41+
COPTS
42+
${ABSL_DEFAULT_COPTS}
43+
DEPS
44+
absl::core_headers
45+
)
46+
47+
absl_cc_test(
48+
NAME
49+
num_initializers_internal_test
50+
SRCS
51+
"internal/num_initializers_test.cc"
52+
COPTS
53+
${ABSL_TEST_COPTS}
54+
DEPS
55+
absl::num_initializers_internal
56+
GTest::gmock_main
57+
)
58+
59+
absl_cc_library(
60+
NAME
61+
num_bases_internal
62+
HDRS
63+
"internal/num_bases.h"
64+
COPTS
65+
${ABSL_DEFAULT_COPTS}
66+
DEPS
67+
absl::num_initializers_internal
68+
absl::type_traits
69+
absl::optional
70+
)
71+
72+
absl_cc_test(
73+
NAME
74+
num_bases_internal_test
75+
SRCS
76+
"internal/num_bases_test.cc"
77+
COPTS
78+
${ABSL_TEST_COPTS}
79+
DEPS
80+
absl::num_bases_internal
81+
GTest::gmock_main
82+
)
83+
84+
absl_cc_library(
85+
NAME
86+
aggregate_internal
87+
HDRS
88+
"internal/aggregate.h"
89+
COPTS
90+
${ABSL_DEFAULT_COPTS}
91+
DEPS
92+
absl::num_bases_internal
93+
absl::num_initializers_internal
94+
)
95+
96+
absl_cc_test(
97+
NAME
98+
aggregate_internal_test
99+
SRCS
100+
"internal/aggregate_test.cc"
101+
COPTS
102+
${ABSL_TEST_COPTS}
103+
DEPS
104+
absl::aggregate_internal
105+
GTest::gmock_main
106+
)
107+
108+
absl_cc_library(
109+
NAME
110+
tuple_internal
111+
HDRS
112+
"internal/tuple.h"
113+
COPTS
114+
${ABSL_DEFAULT_COPTS}
115+
)
116+
117+
absl_cc_library(
118+
NAME
119+
is_tuple_hashable_internal
120+
HDRS
121+
"internal/is_tuple_hashable.h"
122+
COPTS
123+
${ABSL_DEFAULT_COPTS}
124+
DEPS
125+
absl::hash
126+
)
127+
128+
absl_cc_library(
129+
NAME
130+
reflection_internal
131+
HDRS
132+
"internal/reflection.h"
133+
SRCS
134+
"internal/reflection.cc"
135+
COPTS
136+
${ABSL_DEFAULT_COPTS}
137+
DEPS
138+
absl::strings
139+
absl::span
140+
)

absl/extend/internal/BUILD.bazel

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Copyright 2026 The Abseil Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
load("@rules_cc//cc:cc_library.bzl", "cc_library")
16+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
17+
18+
# Internal extend utilities and implementation details.
19+
package(
20+
default_visibility = [
21+
"//absl/extend:__subpackages__",
22+
],
23+
features = ["header_modules"],
24+
)
25+
26+
cc_library(
27+
name = "tuple",
28+
hdrs = ["tuple.h"],
29+
deps = ["//absl/base:config"],
30+
)
31+
32+
cc_library(
33+
name = "is_tuple_hashable",
34+
hdrs = ["is_tuple_hashable.h"],
35+
deps = [
36+
"//absl/base:config",
37+
"//absl/hash",
38+
],
39+
)
40+
41+
cc_library(
42+
name = "reflection",
43+
srcs = ["reflection.cc"],
44+
hdrs = ["reflection.h"],
45+
deps = [
46+
"//absl/base:config",
47+
"//absl/strings",
48+
"//absl/types:span",
49+
],
50+
)
51+
52+
cc_library(
53+
name = "aggregate",
54+
hdrs = ["aggregate.h"],
55+
deps = [
56+
":num_bases",
57+
":num_initializers",
58+
"//absl/base:config",
59+
],
60+
)
61+
62+
cc_test(
63+
name = "aggregate_test",
64+
srcs = ["aggregate_test.cc"],
65+
deps = [
66+
":aggregate",
67+
"//absl/base:config",
68+
"@googletest//:gtest_main",
69+
],
70+
)
71+
72+
cc_library(
73+
name = "num_bases",
74+
hdrs = ["num_bases.h"],
75+
deps = [
76+
":num_initializers",
77+
"//absl/base:config",
78+
],
79+
)
80+
81+
cc_test(
82+
name = "num_bases_test",
83+
srcs = ["num_bases_test.cc"],
84+
deps = [
85+
":num_bases",
86+
"//absl/base:config",
87+
"@googletest//:gtest_main",
88+
],
89+
)
90+
91+
cc_library(
92+
name = "num_initializers",
93+
hdrs = ["num_initializers.h"],
94+
deps = [
95+
"//absl/base:config",
96+
"//absl/base:core_headers",
97+
],
98+
)
99+
100+
cc_test(
101+
name = "num_initializers_test",
102+
srcs = ["num_initializers_test.cc"],
103+
tags = [
104+
"no_test_ios_arm64",
105+
],
106+
deps = [
107+
":num_initializers",
108+
"//absl/base:config",
109+
"@googletest//:gtest_main",
110+
],
111+
)
112+
113+
cc_library(
114+
name = "dependencies",
115+
hdrs = ["dependencies.h"],
116+
deps = ["//absl/base:config"],
117+
)
118+
119+
cc_test(
120+
name = "dependencies_test",
121+
srcs = ["dependencies_test.cc"],
122+
deps = [
123+
":dependencies",
124+
"//absl/base:config",
125+
"@googletest//:gtest_main",
126+
],
127+
)

0 commit comments

Comments
 (0)