xref: /aosp_15_r20/external/webrtc/third_party/abseil-cpp/absl/status/BUILD.bazel (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1#
2# Copyright 2017 The Abseil Authors.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      https://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# This package contains `absl::Status`.
17# It will expand later to have utilities around `Status` like `StatusOr`,
18# `StatusBuilder` and macros.
19
20load(
21    "//absl:copts/configure_copts.bzl",
22    "ABSL_DEFAULT_COPTS",
23    "ABSL_DEFAULT_LINKOPTS",
24    "ABSL_TEST_COPTS",
25)
26
27package(default_visibility = ["//visibility:public"])
28
29licenses(["notice"])
30
31cc_library(
32    name = "status",
33    srcs = [
34        "internal/status_internal.h",
35        "status.cc",
36        "status_payload_printer.cc",
37    ],
38    hdrs = [
39        "status.h",
40        "status_payload_printer.h",
41    ],
42    copts = ABSL_DEFAULT_COPTS,
43    linkopts = ABSL_DEFAULT_LINKOPTS,
44    deps = [
45        "//absl/base:atomic_hook",
46        "//absl/base:core_headers",
47        "//absl/base:raw_logging_internal",
48        "//absl/base:strerror",
49        "//absl/container:inlined_vector",
50        "//absl/debugging:stacktrace",
51        "//absl/debugging:symbolize",
52        "//absl/functional:function_ref",
53        "//absl/strings",
54        "//absl/strings:cord",
55        "//absl/strings:str_format",
56        "//absl/types:optional",
57    ],
58)
59
60cc_test(
61    name = "status_test",
62    srcs = ["status_test.cc"],
63    copts = ABSL_TEST_COPTS,
64    deps = [
65        ":status",
66        "//absl/strings",
67        "@com_google_googletest//:gtest_main",
68    ],
69)
70
71cc_library(
72    name = "statusor",
73    srcs = [
74        "internal/statusor_internal.h",
75        "statusor.cc",
76    ],
77    hdrs = [
78        "statusor.h",
79    ],
80    copts = ABSL_DEFAULT_COPTS,
81    linkopts = ABSL_DEFAULT_LINKOPTS,
82    deps = [
83        ":status",
84        "//absl/base",
85        "//absl/base:core_headers",
86        "//absl/base:raw_logging_internal",
87        "//absl/meta:type_traits",
88        "//absl/strings",
89        "//absl/types:variant",
90        "//absl/utility",
91    ],
92)
93
94cc_test(
95    name = "statusor_test",
96    size = "small",
97    srcs = ["statusor_test.cc"],
98    deps = [
99        ":status",
100        ":statusor",
101        "//absl/base",
102        "//absl/memory",
103        "//absl/strings",
104        "//absl/types:any",
105        "//absl/utility",
106        "@com_google_googletest//:gtest_main",
107    ],
108)
109