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("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") 16load( 17 "//absl:copts/configure_copts.bzl", 18 "ABSL_DEFAULT_COPTS", 19 "ABSL_DEFAULT_LINKOPTS", 20 "ABSL_TEST_COPTS", 21) 22 23package(default_visibility = ["//visibility:public"]) 24 25licenses(["notice"]) 26 27cc_library( 28 name = "cleanup_internal", 29 hdrs = ["internal/cleanup.h"], 30 copts = ABSL_DEFAULT_COPTS, 31 linkopts = ABSL_DEFAULT_LINKOPTS, 32 deps = [ 33 "//absl/base:base_internal", 34 "//absl/base:core_headers", 35 "//absl/utility", 36 ], 37) 38 39cc_library( 40 name = "cleanup", 41 hdrs = [ 42 "cleanup.h", 43 ], 44 copts = ABSL_DEFAULT_COPTS, 45 linkopts = ABSL_DEFAULT_LINKOPTS, 46 deps = [ 47 ":cleanup_internal", 48 "//absl/base:config", 49 "//absl/base:core_headers", 50 ], 51) 52 53cc_test( 54 name = "cleanup_test", 55 size = "small", 56 srcs = [ 57 "cleanup_test.cc", 58 ], 59 copts = ABSL_TEST_COPTS, 60 deps = [ 61 ":cleanup", 62 "//absl/base:config", 63 "//absl/utility", 64 "@com_google_googletest//:gtest_main", 65 ], 66) 67