BUILD 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
  5. package(default_visibility = ["//visibility:public"])
  6. cc_library(
  7. name = "bazel_working_dir",
  8. hdrs = ["bazel_working_dir.h"],
  9. deps = [
  10. "@llvm-project//llvm:Support",
  11. ],
  12. )
  13. cc_library(
  14. name = "command_line",
  15. srcs = ["command_line.cpp"],
  16. hdrs = ["command_line.h"],
  17. deps = [
  18. ":check",
  19. ":ostream",
  20. "@llvm-project//llvm:Support",
  21. ],
  22. )
  23. cc_test(
  24. name = "command_line_test",
  25. size = "small",
  26. srcs = ["command_line_test.cpp"],
  27. deps = [
  28. ":command_line",
  29. "//testing/base:gtest_main",
  30. "//testing/base:test_raw_ostream",
  31. "@com_google_googletest//:gtest",
  32. "@llvm-project//llvm:Support",
  33. ],
  34. )
  35. cc_library(
  36. name = "check",
  37. srcs = [
  38. "check_internal.cpp",
  39. "check_internal.h",
  40. ],
  41. hdrs = ["check.h"],
  42. deps = [
  43. ":ostream",
  44. "@llvm-project//llvm:Support",
  45. ],
  46. )
  47. cc_test(
  48. name = "check_test",
  49. size = "small",
  50. srcs = ["check_test.cpp"],
  51. deps = [
  52. ":check",
  53. "//testing/base:gtest_main",
  54. "@com_google_googletest//:gtest",
  55. ],
  56. )
  57. cc_library(
  58. name = "enum_base",
  59. hdrs = ["enum_base.h"],
  60. deps = [
  61. "//common:ostream",
  62. "@llvm-project//llvm:Support",
  63. ],
  64. )
  65. cc_library(
  66. name = "enum_base_test_def",
  67. testonly = 1,
  68. textual_hdrs = ["enum_base_test.def"],
  69. )
  70. cc_test(
  71. name = "enum_base_test",
  72. size = "small",
  73. srcs = ["enum_base_test.cpp"],
  74. deps = [
  75. ":enum_base",
  76. ":enum_base_test_def",
  77. "//testing/base:gtest_main",
  78. "//testing/base:test_raw_ostream",
  79. "@com_google_googletest//:gtest",
  80. ],
  81. )
  82. cc_library(
  83. name = "error",
  84. hdrs = ["error.h"],
  85. deps = [
  86. ":check",
  87. ":ostream",
  88. "@llvm-project//llvm:Support",
  89. ],
  90. )
  91. cc_test(
  92. name = "error_test",
  93. size = "small",
  94. srcs = ["error_test.cpp"],
  95. deps = [
  96. ":error",
  97. "//testing/base:gtest_main",
  98. "//testing/base:test_raw_ostream",
  99. "@com_google_googletest//:gtest",
  100. ],
  101. )
  102. cc_library(
  103. name = "hashing",
  104. srcs = ["hashing.cpp"],
  105. hdrs = ["hashing.h"],
  106. deps = [
  107. ":check",
  108. ":ostream",
  109. "@llvm-project//llvm:Support",
  110. ],
  111. )
  112. cc_test(
  113. name = "hashing_test",
  114. srcs = ["hashing_test.cpp"],
  115. deps = [
  116. ":hashing",
  117. "//testing/base:gtest_main",
  118. "//testing/base:test_raw_ostream",
  119. "@com_google_googletest//:gtest",
  120. "@llvm-project//llvm:Support",
  121. ],
  122. )
  123. cc_binary(
  124. name = "hashing_benchmark",
  125. testonly = 1,
  126. srcs = ["hashing_benchmark.cpp"],
  127. deps = [
  128. ":check",
  129. ":hashing",
  130. "@com_github_google_benchmark//:benchmark_main",
  131. "@com_google_absl//absl/hash",
  132. "@com_google_absl//absl/random",
  133. "@llvm-project//llvm:Support",
  134. ],
  135. )
  136. cc_library(
  137. name = "indirect_value",
  138. hdrs = ["indirect_value.h"],
  139. )
  140. cc_test(
  141. name = "indirect_value_test",
  142. size = "small",
  143. srcs = ["indirect_value_test.cpp"],
  144. deps = [
  145. ":indirect_value",
  146. "//testing/base:gtest_main",
  147. "@com_google_googletest//:gtest",
  148. ],
  149. )
  150. cc_library(
  151. name = "ostream",
  152. hdrs = ["ostream.h"],
  153. deps = [
  154. "@llvm-project//llvm:Support",
  155. ],
  156. )
  157. cc_library(
  158. name = "string_helpers",
  159. srcs = ["string_helpers.cpp"],
  160. hdrs = ["string_helpers.h"],
  161. deps = [
  162. ":check",
  163. ":error",
  164. "@llvm-project//llvm:Support",
  165. ],
  166. )
  167. cc_test(
  168. name = "string_helpers_test",
  169. size = "small",
  170. srcs = ["string_helpers_test.cpp"],
  171. deps = [
  172. ":string_helpers",
  173. "//testing/base:gtest_main",
  174. "@com_google_googletest//:gtest",
  175. "@llvm-project//llvm:Support",
  176. ],
  177. )
  178. cc_library(
  179. name = "struct_reflection",
  180. hdrs = ["struct_reflection.h"],
  181. )
  182. cc_test(
  183. name = "struct_reflection_test",
  184. size = "small",
  185. srcs = ["struct_reflection_test.cpp"],
  186. deps = [
  187. ":struct_reflection",
  188. "//testing/base:gtest_main",
  189. "@com_google_googletest//:gtest",
  190. ],
  191. )
  192. cc_library(
  193. name = "vlog",
  194. srcs = ["vlog_internal.h"],
  195. hdrs = ["vlog.h"],
  196. deps = [
  197. ":ostream",
  198. "@llvm-project//llvm:Support",
  199. ],
  200. )
  201. cc_test(
  202. name = "vlog_test",
  203. size = "small",
  204. srcs = ["vlog_test.cpp"],
  205. deps = [
  206. ":vlog",
  207. "//testing/base:gtest_main",
  208. "//testing/base:test_raw_ostream",
  209. "@com_google_googletest//:gtest",
  210. ],
  211. )