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 = "bind_front", 30 srcs = ["internal/front_binder.h"], 31 hdrs = ["bind_front.h"], 32 copts = ABSL_DEFAULT_COPTS, 33 linkopts = ABSL_DEFAULT_LINKOPTS, 34 deps = [ 35 "//absl/base:base_internal", 36 "//absl/container:compressed_tuple", 37 "//absl/meta:type_traits", 38 "//absl/utility", 39 ], 40) 41 42cc_test( 43 name = "bind_front_test", 44 srcs = ["bind_front_test.cc"], 45 copts = ABSL_TEST_COPTS, 46 linkopts = ABSL_DEFAULT_LINKOPTS, 47 deps = [ 48 ":bind_front", 49 "//absl/memory", 50 "@com_google_googletest//:gtest_main", 51 ], 52) 53 54cc_library( 55 name = "function_ref", 56 srcs = ["internal/function_ref.h"], 57 hdrs = ["function_ref.h"], 58 copts = ABSL_DEFAULT_COPTS, 59 linkopts = ABSL_DEFAULT_LINKOPTS, 60 deps = [ 61 "//absl/base:base_internal", 62 "//absl/base:core_headers", 63 "//absl/meta:type_traits", 64 ], 65) 66 67cc_test( 68 name = "function_ref_test", 69 size = "small", 70 srcs = ["function_ref_test.cc"], 71 copts = ABSL_TEST_COPTS, 72 deps = [ 73 ":function_ref", 74 "//absl/container:test_instance_tracker", 75 "//absl/memory", 76 "@com_google_googletest//:gtest_main", 77 ], 78) 79 80cc_test( 81 name = "function_ref_benchmark", 82 srcs = [ 83 "function_ref_benchmark.cc", 84 ], 85 copts = ABSL_TEST_COPTS, 86 tags = ["benchmark"], 87 visibility = ["//visibility:private"], 88 deps = [ 89 ":function_ref", 90 "//absl/base:core_headers", 91 "@com_github_google_benchmark//:benchmark_main", 92 ], 93) 94