BUILD.bazel 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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(
  23. default_visibility = ["//visibility:public"],
  24. features = [
  25. "header_modules",
  26. "layering_check",
  27. "parse_headers",
  28. ],
  29. )
  30. licenses(["notice"])
  31. cc_library(
  32. name = "any_invocable",
  33. srcs = ["internal/any_invocable.h"],
  34. hdrs = ["any_invocable.h"],
  35. copts = ABSL_DEFAULT_COPTS,
  36. linkopts = ABSL_DEFAULT_LINKOPTS,
  37. deps = [
  38. "//absl/base:base_internal",
  39. "//absl/base:config",
  40. "//absl/base:core_headers",
  41. "//absl/meta:type_traits",
  42. "//absl/utility",
  43. ],
  44. )
  45. cc_test(
  46. name = "any_invocable_test",
  47. srcs = [
  48. "any_invocable_test.cc",
  49. "internal/any_invocable.h",
  50. ],
  51. copts = ABSL_TEST_COPTS,
  52. linkopts = ABSL_DEFAULT_LINKOPTS,
  53. deps = [
  54. ":any_invocable",
  55. "//absl/base:base_internal",
  56. "//absl/base:config",
  57. "//absl/base:core_headers",
  58. "//absl/meta:type_traits",
  59. "//absl/utility",
  60. "@com_google_googletest//:gtest",
  61. "@com_google_googletest//:gtest_main",
  62. ],
  63. )
  64. cc_library(
  65. name = "bind_front",
  66. srcs = ["internal/front_binder.h"],
  67. hdrs = ["bind_front.h"],
  68. copts = ABSL_DEFAULT_COPTS,
  69. linkopts = ABSL_DEFAULT_LINKOPTS,
  70. deps = [
  71. "//absl/base:base_internal",
  72. "//absl/container:compressed_tuple",
  73. "//absl/meta:type_traits",
  74. "//absl/utility",
  75. ],
  76. )
  77. cc_test(
  78. name = "bind_front_test",
  79. srcs = ["bind_front_test.cc"],
  80. copts = ABSL_TEST_COPTS,
  81. linkopts = ABSL_DEFAULT_LINKOPTS,
  82. deps = [
  83. ":bind_front",
  84. "//absl/memory",
  85. "@com_google_googletest//:gtest",
  86. "@com_google_googletest//:gtest_main",
  87. ],
  88. )
  89. cc_library(
  90. name = "function_ref",
  91. srcs = ["internal/function_ref.h"],
  92. hdrs = ["function_ref.h"],
  93. copts = ABSL_DEFAULT_COPTS,
  94. linkopts = ABSL_DEFAULT_LINKOPTS,
  95. deps = [
  96. ":any_invocable",
  97. "//absl/base:base_internal",
  98. "//absl/base:core_headers",
  99. "//absl/meta:type_traits",
  100. ],
  101. )
  102. cc_test(
  103. name = "function_ref_test",
  104. size = "small",
  105. srcs = ["function_ref_test.cc"],
  106. copts = ABSL_TEST_COPTS,
  107. deps = [
  108. ":any_invocable",
  109. ":function_ref",
  110. "//absl/container:test_instance_tracker",
  111. "//absl/memory",
  112. "@com_google_googletest//:gtest",
  113. "@com_google_googletest//:gtest_main",
  114. ],
  115. )
  116. cc_library(
  117. name = "overload",
  118. hdrs = ["overload.h"],
  119. copts = ABSL_DEFAULT_COPTS,
  120. linkopts = ABSL_DEFAULT_LINKOPTS,
  121. deps = [
  122. "//absl/base:config",
  123. "//absl/meta:type_traits",
  124. ],
  125. )
  126. cc_test(
  127. name = "overload_test",
  128. size = "small",
  129. srcs = ["overload_test.cc"],
  130. copts = ABSL_TEST_COPTS,
  131. deps = [
  132. ":overload",
  133. "//absl/base:config",
  134. "//absl/strings",
  135. "//absl/strings:string_view",
  136. "//absl/types:variant",
  137. "@com_google_googletest//:gtest",
  138. "@com_google_googletest//:gtest_main",
  139. ],
  140. )
  141. cc_test(
  142. name = "function_type_benchmark",
  143. srcs = [
  144. "function_type_benchmark.cc",
  145. ],
  146. copts = ABSL_TEST_COPTS,
  147. tags = ["benchmark"],
  148. visibility = ["//visibility:private"],
  149. deps = [
  150. ":any_invocable",
  151. ":function_ref",
  152. "//absl/base:core_headers",
  153. "@com_github_google_benchmark//:benchmark_main",
  154. "@com_google_googletest//:gtest",
  155. ],
  156. )