xref: /aosp_15_r20/external/abseil-cpp/absl/cleanup/BUILD.bazel (revision 9356374a3709195abf420251b3e825997ff56c0f)
1# Copyright 2021 The Abseil Authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15load(
16    "//absl:copts/configure_copts.bzl",
17    "ABSL_DEFAULT_COPTS",
18    "ABSL_DEFAULT_LINKOPTS",
19    "ABSL_TEST_COPTS",
20)
21
22package(
23    default_visibility = ["//visibility:public"],
24    features = [
25        "header_modules",
26        "layering_check",
27        "parse_headers",
28    ],
29)
30
31licenses(["notice"])
32
33cc_library(
34    name = "cleanup_internal",
35    hdrs = ["internal/cleanup.h"],
36    copts = ABSL_DEFAULT_COPTS,
37    linkopts = ABSL_DEFAULT_LINKOPTS,
38    deps = [
39        "//absl/base:base_internal",
40        "//absl/base:core_headers",
41        "//absl/utility",
42    ],
43)
44
45cc_library(
46    name = "cleanup",
47    hdrs = [
48        "cleanup.h",
49    ],
50    copts = ABSL_DEFAULT_COPTS,
51    linkopts = ABSL_DEFAULT_LINKOPTS,
52    deps = [
53        ":cleanup_internal",
54        "//absl/base:config",
55        "//absl/base:core_headers",
56    ],
57)
58
59cc_test(
60    name = "cleanup_test",
61    size = "small",
62    srcs = [
63        "cleanup_test.cc",
64    ],
65    copts = ABSL_TEST_COPTS,
66    deps = [
67        ":cleanup",
68        "//absl/base:config",
69        "//absl/utility",
70        "@com_google_googletest//:gtest",
71        "@com_google_googletest//:gtest_main",
72    ],
73)
74