1# 2# Copyright 2019 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 17load( 18 "//absl:copts/configure_copts.bzl", 19 "ABSL_DEFAULT_COPTS", 20 "ABSL_DEFAULT_LINKOPTS", 21 "ABSL_TEST_COPTS", 22) 23 24package(default_visibility = ["//visibility:public"]) 25 26licenses(["notice"]) 27 28cc_library( 29 name = "any_invocable", 30 srcs = ["internal/any_invocable.h"], 31 hdrs = ["any_invocable.h"], 32 copts = ABSL_DEFAULT_COPTS, 33 linkopts = ABSL_DEFAULT_LINKOPTS, 34 deps = [ 35 "//absl/base:base_internal", 36 "//absl/base:config", 37 "//absl/base:core_headers", 38 "//absl/meta:type_traits", 39 "//absl/utility", 40 ], 41) 42 43cc_test( 44 name = "any_invocable_test", 45 srcs = [ 46 "any_invocable_test.cc", 47 "internal/any_invocable.h", 48 ], 49 copts = ABSL_TEST_COPTS, 50 linkopts = ABSL_DEFAULT_LINKOPTS, 51 deps = [ 52 ":any_invocable", 53 "//absl/base:base_internal", 54 "//absl/base:config", 55 "//absl/base:core_headers", 56 "//absl/meta:type_traits", 57 "//absl/utility", 58 "@com_google_googletest//:gtest_main", 59 ], 60) 61 62cc_library( 63 name = "bind_front", 64 srcs = ["internal/front_binder.h"], 65 hdrs = ["bind_front.h"], 66 copts = ABSL_DEFAULT_COPTS, 67 linkopts = ABSL_DEFAULT_LINKOPTS, 68 deps = [ 69 "//absl/base:base_internal", 70 "//absl/container:compressed_tuple", 71 "//absl/meta:type_traits", 72 "//absl/utility", 73 ], 74) 75 76cc_test( 77 name = "bind_front_test", 78 srcs = ["bind_front_test.cc"], 79 copts = ABSL_TEST_COPTS, 80 linkopts = ABSL_DEFAULT_LINKOPTS, 81 deps = [ 82 ":bind_front", 83 "//absl/memory", 84 "@com_google_googletest//:gtest_main", 85 ], 86) 87 88cc_library( 89 name = "function_ref", 90 srcs = ["internal/function_ref.h"], 91 hdrs = ["function_ref.h"], 92 copts = ABSL_DEFAULT_COPTS, 93 linkopts = ABSL_DEFAULT_LINKOPTS, 94 deps = [ 95 "//absl/base:base_internal", 96 "//absl/base:core_headers", 97 "//absl/meta:type_traits", 98 ], 99) 100 101cc_test( 102 name = "function_ref_test", 103 size = "small", 104 srcs = ["function_ref_test.cc"], 105 copts = ABSL_TEST_COPTS, 106 deps = [ 107 ":function_ref", 108 "//absl/container:test_instance_tracker", 109 "//absl/memory", 110 "@com_google_googletest//:gtest_main", 111 ], 112) 113 114cc_test( 115 name = "function_type_benchmark", 116 srcs = [ 117 "function_type_benchmark.cc", 118 ], 119 copts = ABSL_TEST_COPTS, 120 tags = ["benchmark"], 121 visibility = ["//visibility:private"], 122 deps = [ 123 ":any_invocable", 124 ":function_ref", 125 "//absl/base:core_headers", 126 "@com_github_google_benchmark//:benchmark_main", 127 ], 128) 129