xref: /aosp_15_r20/external/cronet/third_party/abseil-cpp/absl/base/BUILD.gn (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2018 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//third_party/abseil-cpp/absl.gni")
6
7absl_source_set("atomic_hook") {
8  public = [ "internal/atomic_hook.h" ]
9  public_deps = [
10    ":config",
11    ":core_headers",
12  ]
13  visibility = [ "//third_party/abseil-cpp/absl/*" ]
14}
15
16absl_source_set("errno_saver") {
17  public = [ "internal/errno_saver.h" ]
18  public_deps = [ ":config" ]
19  visibility = [ "//third_party/abseil-cpp/absl/*" ]
20}
21
22absl_source_set("log_severity") {
23  sources = [ "log_severity.cc" ]
24  public = [ "log_severity.h" ]
25  public_deps = [
26    ":config",
27    ":core_headers",
28  ]
29}
30
31absl_source_set("no_destructor") {
32  public = [ "no_destructor.h" ]
33  deps = [
34    ":config",
35    ":nullability",
36  ]
37}
38
39absl_source_set("nullability") {
40  sources = [ "internal/nullability_impl.h" ]
41  public = [ "nullability.h" ]
42  deps = [
43    ":core_headers",
44    "//third_party/abseil-cpp/absl/meta:type_traits",
45  ]
46}
47
48absl_source_set("raw_logging_internal") {
49  sources = [ "internal/raw_logging.cc" ]
50  public = [ "internal/raw_logging.h" ]
51  public_deps = [
52    ":atomic_hook",
53    ":config",
54    ":core_headers",
55    ":errno_saver",
56    ":log_severity",
57  ]
58  visibility = [ "//third_party/abseil-cpp/absl/*" ]
59}
60
61absl_source_set("spinlock_wait") {
62  sources = [
63    "internal/spinlock_akaros.inc",
64    "internal/spinlock_linux.inc",
65    "internal/spinlock_posix.inc",
66    "internal/spinlock_wait.cc",
67    "internal/spinlock_win32.inc",
68  ]
69  public = [ "internal/spinlock_wait.h" ]
70  deps = [
71    ":base_internal",
72    ":core_headers",
73    ":errno_saver",
74  ]
75  visibility = [ "//third_party/abseil-cpp/absl/base:*" ]
76}
77
78absl_source_set("config") {
79  public = [
80    "config.h",
81    "options.h",
82    "policy_checks.h",
83  ]
84}
85
86absl_source_set("cycleclock_internal") {
87  public = [
88    "internal/cycleclock_config.h",
89    "internal/unscaledcycleclock_config.h",
90  ]
91  visibility = [ "//third_party/abseil-cpp/absl/*" ]
92  deps = [
93    ":base_internal",
94    ":config",
95  ]
96}
97
98absl_source_set("dynamic_annotations") {
99  public = [ "dynamic_annotations.h" ]
100
101  # Abseil's dynamic annotations are only visible inside Abseil because
102  # their usage is deprecated in Chromium (see README.chromium for more info).
103  visibility = [ "//third_party/abseil-cpp/absl/*" ]
104  deps = [
105    ":config",
106    ":core_headers",
107  ]
108}
109
110absl_source_set("core_headers") {
111  public = [
112    "attributes.h",
113    "const_init.h",
114    "macros.h",
115    "optimization.h",
116    "port.h",
117    "thread_annotations.h",
118  ]
119  public_deps = [ ":config" ]
120}
121
122absl_source_set("malloc_internal") {
123  sources = [ "internal/low_level_alloc.cc" ]
124  public = [
125    "internal/direct_mmap.h",
126    "internal/low_level_alloc.h",
127  ]
128  public_deps = [
129    ":base",
130    ":base_internal",
131    ":config",
132    ":core_headers",
133    ":dynamic_annotations",
134    ":raw_logging_internal",
135  ]
136}
137
138absl_source_set("base_internal") {
139  public = [
140    "internal/hide_ptr.h",
141    "internal/identity.h",
142    "internal/inline_variable.h",
143    "internal/invoke.h",
144    "internal/scheduling_mode.h",
145  ]
146  public_deps = [
147    ":config",
148    "//third_party/abseil-cpp/absl/meta:type_traits",
149  ]
150  visibility = [ "//third_party/abseil-cpp/absl/*" ]
151}
152
153absl_source_set("base") {
154  sources = [
155    "internal/cycleclock.cc",
156    "internal/spinlock.cc",
157    "internal/sysinfo.cc",
158    "internal/thread_identity.cc",
159    "internal/unscaledcycleclock.cc",
160  ]
161  public = [
162    "call_once.h",
163    "casts.h",
164    "internal/cycleclock.h",
165    "internal/low_level_scheduling.h",
166    "internal/per_thread_tls.h",
167    "internal/spinlock.h",
168    "internal/sysinfo.h",
169    "internal/thread_identity.h",
170    "internal/tsan_mutex_interface.h",
171    "internal/unscaledcycleclock.h",
172  ]
173
174  # TODO(mbonadei): The bazel file has:
175  #   "-DEFAULTLIB:advapi32.lib"
176  # understand if this is needed here as well.
177  public_deps = [
178    ":atomic_hook",
179    ":base_internal",
180    ":config",
181    ":core_headers",
182    ":cycleclock_internal",
183    ":dynamic_annotations",
184    ":log_severity",
185    ":nullability",
186    ":raw_logging_internal",
187    ":spinlock_wait",
188    "//third_party/abseil-cpp/absl/meta:type_traits",
189  ]
190}
191
192absl_source_set("throw_delegate") {
193  sources = [ "internal/throw_delegate.cc" ]
194  public = [ "internal/throw_delegate.h" ]
195  public_deps = [
196    ":config",
197    ":raw_logging_internal",
198  ]
199  visibility = [ "//third_party/abseil-cpp/absl/*" ]
200}
201
202absl_source_set("exception_testing") {
203  testonly = true
204  public = [ "internal/exception_testing.h" ]
205  public_deps = [ ":config" ]
206  visibility = [ "//third_party/abseil-cpp/absl/*" ]
207}
208
209absl_source_set("pretty_function") {
210  public = [ "internal/pretty_function.h" ]
211  visibility = [ "//third_party/abseil-cpp/absl/*" ]
212}
213
214# TODO(mbonadei): This target throws by design. We should probably
215# just remove it.
216# source_set("exception_safety_testing") {
217#   testonly = true
218#   configs -= [ "//build/config/compiler:chromium_code" ]
219#   configs += [
220#     "//build/config/compiler:no_chromium_code",
221#     "//third_party/abseil-cpp:absl_test_cflags_cc",
222#   ]
223#   public_configs = [ "//third_party/abseil-cpp:absl_include_config" ]
224#   sources = [
225#     "internal/exception_safety_testing.cc",
226#   ]
227#   public = [
228#     "internal/exception_safety_testing.h",
229#   ]
230#   deps = [
231#     ":config",
232#     ":pretty_function",
233#     "//third_party/abseil-cpp/absl/memory",
234#     "//third_party/abseil-cpp/absl/meta:type_traits",
235#     "//third_party/abseil-cpp/absl/strings",
236#     "//third_party/abseil-cpp/absl/utility",
237#     "//third_party/googletest:gtest",
238#   ]
239# }
240
241absl_source_set("spinlock_test_common") {
242  testonly = true
243  sources = [ "spinlock_test_common.cc" ]
244  deps = [
245    ":base",
246    ":base_internal",
247    ":config",
248    ":core_headers",
249    "//third_party/abseil-cpp/absl/synchronization",
250    "//third_party/googletest:gtest",
251  ]
252}
253
254absl_source_set("endian") {
255  public = [
256    "internal/endian.h",
257    "internal/unaligned_access.h",
258  ]
259  public_deps = [
260    ":base",
261    ":config",
262    ":core_headers",
263    ":nullability",
264  ]
265}
266
267absl_source_set("scoped_set_env") {
268  testonly = true
269  public = [ "internal/scoped_set_env.h" ]
270  sources = [ "internal/scoped_set_env.cc" ]
271  public_deps = [ ":config" ]
272  deps = [ ":raw_logging_internal" ]
273  visibility = [ "//third_party/abseil-cpp/absl/*" ]
274}
275
276absl_source_set("strerror") {
277  sources = [ "internal/strerror.cc" ]
278  public = [ "internal/strerror.h" ]
279  public_deps = [ ":config" ]
280  deps = [
281    ":core_headers",
282    ":errno_saver",
283  ]
284  visibility = [ "//third_party/abseil-cpp/absl/*" ]
285}
286
287absl_source_set("fast_type_id") {
288  public = [ "internal/fast_type_id.h" ]
289  public_deps = [ ":config" ]
290  visibility = [ "//third_party/abseil-cpp/absl/*" ]
291}
292
293absl_source_set("prefetch") {
294  public = [ "prefetch.h" ]
295  deps = [
296    ":config",
297    ":core_headers",
298  ]
299}
300
301absl_test("prefetch_test") {
302  sources = [ "prefetch_test.cc" ]
303  deps = [ ":prefetch" ]
304}
305
306absl_test("config_test") {
307  sources = [ "config_test.cc" ]
308  deps = [
309    ":config",
310    "//third_party/abseil-cpp/absl/synchronization:thread_pool",
311  ]
312}
313
314absl_test("no_destructor_test") {
315  sources = [ "no_destructor_test.cc" ]
316  deps = [
317    ":config",
318    ":no_destructor",
319    ":raw_logging_internal",
320  ]
321}
322
323absl_test("nullability_test") {
324  sources = [ "nullability_test.cc" ]
325  deps = [
326    ":core_headers",
327    ":nullability",
328  ]
329}
330