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("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") 21load( 22 "//absl:copts/configure_copts.bzl", 23 "ABSL_DEFAULT_COPTS", 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 deps = [ 44 "//absl/base:atomic_hook", 45 "//absl/base:config", 46 "//absl/base:core_headers", 47 "//absl/base:raw_logging_internal", 48 "//absl/container:inlined_vector", 49 "//absl/debugging:stacktrace", 50 "//absl/debugging:symbolize", 51 "//absl/strings", 52 "//absl/strings:cord", 53 "//absl/strings:str_format", 54 "//absl/types:optional", 55 ], 56) 57 58cc_test( 59 name = "status_test", 60 srcs = ["status_test.cc"], 61 copts = ABSL_TEST_COPTS, 62 deps = [ 63 ":status", 64 "//absl/strings", 65 "@com_google_googletest//:gtest_main", 66 ], 67) 68 69cc_library( 70 name = "statusor", 71 srcs = [ 72 "internal/statusor_internal.h", 73 "statusor.cc", 74 ], 75 hdrs = [ 76 "statusor.h", 77 ], 78 copts = ABSL_DEFAULT_COPTS, 79 deps = [ 80 ":status", 81 "//absl/base:core_headers", 82 "//absl/base:raw_logging_internal", 83 "//absl/meta:type_traits", 84 "//absl/strings", 85 "//absl/types:variant", 86 "//absl/utility", 87 ], 88) 89 90cc_test( 91 name = "statusor_test", 92 size = "small", 93 srcs = ["statusor_test.cc"], 94 deps = [ 95 ":status", 96 ":statusor", 97 "//absl/base", 98 "//absl/memory", 99 "//absl/types:any", 100 "//absl/utility", 101 "@com_google_googletest//:gtest_main", 102 ], 103) 104