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( 28 default_visibility = ["//visibility:public"], 29 features = [ 30 "header_modules", 31 "layering_check", 32 "parse_headers", 33 ], 34) 35 36licenses(["notice"]) 37 38cc_library( 39 name = "status", 40 srcs = [ 41 "internal/status_internal.cc", 42 "internal/status_internal.h", 43 "status.cc", 44 "status_payload_printer.cc", 45 ], 46 hdrs = [ 47 "status.h", 48 "status_payload_printer.h", 49 ], 50 copts = ABSL_DEFAULT_COPTS, 51 linkopts = ABSL_DEFAULT_LINKOPTS, 52 deps = [ 53 "//absl/base:atomic_hook", 54 "//absl/base:config", 55 "//absl/base:core_headers", 56 "//absl/base:no_destructor", 57 "//absl/base:raw_logging_internal", 58 "//absl/base:strerror", 59 "//absl/container:inlined_vector", 60 "//absl/debugging:stacktrace", 61 "//absl/debugging:symbolize", 62 "//absl/functional:function_ref", 63 "//absl/memory", 64 "//absl/strings", 65 "//absl/strings:cord", 66 "//absl/strings:str_format", 67 "//absl/types:optional", 68 "//absl/types:span", 69 ], 70) 71 72cc_test( 73 name = "status_test", 74 srcs = ["status_test.cc"], 75 copts = ABSL_TEST_COPTS, 76 linkopts = ABSL_DEFAULT_LINKOPTS, 77 deps = [ 78 ":status", 79 "//absl/strings", 80 "//absl/strings:cord", 81 "//absl/strings:str_format", 82 "@com_google_googletest//:gtest", 83 "@com_google_googletest//:gtest_main", 84 ], 85) 86 87cc_library( 88 name = "statusor", 89 srcs = [ 90 "internal/statusor_internal.h", 91 "statusor.cc", 92 ], 93 hdrs = [ 94 "statusor.h", 95 ], 96 copts = ABSL_DEFAULT_COPTS, 97 linkopts = ABSL_DEFAULT_LINKOPTS, 98 deps = [ 99 ":status", 100 "//absl/base", 101 "//absl/base:config", 102 "//absl/base:core_headers", 103 "//absl/base:raw_logging_internal", 104 "//absl/meta:type_traits", 105 "//absl/strings", 106 "//absl/types:variant", 107 "//absl/utility", 108 ], 109) 110 111cc_test( 112 name = "statusor_test", 113 size = "small", 114 srcs = ["statusor_test.cc"], 115 deps = [ 116 ":status", 117 ":statusor", 118 "//absl/base", 119 "//absl/memory", 120 "//absl/strings", 121 "//absl/types:any", 122 "//absl/types:variant", 123 "//absl/utility", 124 "@com_google_googletest//:gtest", 125 "@com_google_googletest//:gtest_main", 126 ], 127) 128