BUILD.bazel 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. load(
  17. "//absl:copts/configure_copts.bzl",
  18. "ABSL_DEFAULT_COPTS",
  19. "ABSL_DEFAULT_LINKOPTS",
  20. "ABSL_TEST_COPTS",
  21. )
  22. package(default_visibility = ["//visibility:public"])
  23. licenses(["notice"])
  24. cc_library(
  25. name = "bind_front",
  26. srcs = ["internal/front_binder.h"],
  27. hdrs = ["bind_front.h"],
  28. copts = ABSL_DEFAULT_COPTS,
  29. linkopts = ABSL_DEFAULT_LINKOPTS,
  30. deps = [
  31. "//absl/base:base_internal",
  32. "//absl/container:compressed_tuple",
  33. "//absl/meta:type_traits",
  34. "//absl/utility",
  35. ],
  36. )
  37. cc_test(
  38. name = "bind_front_test",
  39. srcs = ["bind_front_test.cc"],
  40. copts = ABSL_TEST_COPTS,
  41. linkopts = ABSL_DEFAULT_LINKOPTS,
  42. deps = [
  43. ":bind_front",
  44. "//absl/memory",
  45. "@com_google_googletest//:gtest_main",
  46. ],
  47. )
  48. cc_library(
  49. name = "function_ref",
  50. srcs = ["internal/function_ref.h"],
  51. hdrs = ["function_ref.h"],
  52. copts = ABSL_DEFAULT_COPTS,
  53. linkopts = ABSL_DEFAULT_LINKOPTS,
  54. deps = [
  55. "//absl/base:base_internal",
  56. "//absl/base:core_headers",
  57. "//absl/meta:type_traits",
  58. ],
  59. )
  60. cc_test(
  61. name = "function_ref_test",
  62. size = "small",
  63. srcs = ["function_ref_test.cc"],
  64. copts = ABSL_TEST_COPTS,
  65. deps = [
  66. ":function_ref",
  67. "//absl/container:test_instance_tracker",
  68. "//absl/memory",
  69. "@com_google_googletest//:gtest_main",
  70. ],
  71. )
  72. cc_test(
  73. name = "function_ref_benchmark",
  74. srcs = [
  75. "function_ref_benchmark.cc",
  76. ],
  77. copts = ABSL_TEST_COPTS,
  78. tags = ["benchmark"],
  79. visibility = ["//visibility:private"],
  80. deps = [
  81. ":function_ref",
  82. "//absl/base:core_headers",
  83. "@com_github_google_benchmark//:benchmark_main",
  84. ],
  85. )