BUILD.bazel 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. # This package contains `absl::Status`.
  16. # It will expand later to have utilities around `Status` like `StatusOr`,
  17. # `StatusBuilder` and macros.
  18. load(
  19. "//absl:copts/configure_copts.bzl",
  20. "ABSL_DEFAULT_COPTS",
  21. "ABSL_TEST_COPTS",
  22. )
  23. package(default_visibility = ["//visibility:public"])
  24. licenses(["notice"])
  25. cc_library(
  26. name = "status",
  27. srcs = [
  28. "internal/status_internal.h",
  29. "status.cc",
  30. "status_payload_printer.cc",
  31. ],
  32. hdrs = [
  33. "status.h",
  34. "status_payload_printer.h",
  35. ],
  36. copts = ABSL_DEFAULT_COPTS,
  37. deps = [
  38. "//absl/base:atomic_hook",
  39. "//absl/base:config",
  40. "//absl/base:core_headers",
  41. "//absl/base:raw_logging_internal",
  42. "//absl/container:inlined_vector",
  43. "//absl/debugging:stacktrace",
  44. "//absl/debugging:symbolize",
  45. "//absl/functional:function_ref",
  46. "//absl/strings",
  47. "//absl/strings:cord",
  48. "//absl/strings:str_format",
  49. "//absl/types:optional",
  50. ],
  51. )
  52. cc_test(
  53. name = "status_test",
  54. srcs = ["status_test.cc"],
  55. copts = ABSL_TEST_COPTS,
  56. deps = [
  57. ":status",
  58. "//absl/strings",
  59. "@com_google_googletest//:gtest_main",
  60. ],
  61. )
  62. cc_library(
  63. name = "statusor",
  64. srcs = [
  65. "internal/statusor_internal.h",
  66. "statusor.cc",
  67. ],
  68. hdrs = [
  69. "statusor.h",
  70. ],
  71. copts = ABSL_DEFAULT_COPTS,
  72. deps = [
  73. ":status",
  74. "//absl/base",
  75. "//absl/base:core_headers",
  76. "//absl/base:raw_logging_internal",
  77. "//absl/meta:type_traits",
  78. "//absl/strings",
  79. "//absl/types:variant",
  80. "//absl/utility",
  81. ],
  82. )
  83. cc_test(
  84. name = "statusor_test",
  85. size = "small",
  86. srcs = ["statusor_test.cc"],
  87. deps = [
  88. ":status",
  89. ":statusor",
  90. "//absl/base",
  91. "//absl/memory",
  92. "//absl/strings",
  93. "//absl/types:any",
  94. "//absl/utility",
  95. "@com_google_googletest//:gtest_main",
  96. ],
  97. )