BUILD 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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_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. srcs = ["command_line_test.cpp"],
  26. deps = [
  27. ":command_line",
  28. "//testing/base:gtest_main",
  29. "//testing/base:test_raw_ostream",
  30. "@com_google_googletest//:gtest",
  31. "@llvm-project//llvm:Support",
  32. ],
  33. )
  34. cc_library(
  35. name = "check",
  36. srcs = [
  37. "check_internal.cpp",
  38. "check_internal.h",
  39. ],
  40. hdrs = ["check.h"],
  41. deps = [
  42. ":ostream",
  43. "@llvm-project//llvm:Support",
  44. ],
  45. )
  46. cc_test(
  47. name = "check_test",
  48. srcs = ["check_test.cpp"],
  49. deps = [
  50. ":check",
  51. "//testing/base:gtest_main",
  52. "@com_google_googletest//:gtest",
  53. ],
  54. )
  55. cc_library(
  56. name = "enum_base",
  57. hdrs = ["enum_base.h"],
  58. deps = [
  59. "//common:ostream",
  60. "@llvm-project//llvm:Support",
  61. ],
  62. )
  63. cc_library(
  64. name = "enum_base_test_def",
  65. textual_hdrs = ["enum_base_test.def"],
  66. )
  67. cc_test(
  68. name = "enum_base_test",
  69. srcs = ["enum_base_test.cpp"],
  70. deps = [
  71. ":enum_base",
  72. ":enum_base_test_def",
  73. "//testing/base:gtest_main",
  74. "//testing/base:test_raw_ostream",
  75. "@com_google_googletest//:gtest",
  76. ],
  77. )
  78. cc_library(
  79. name = "error",
  80. hdrs = ["error.h"],
  81. deps = [
  82. ":check",
  83. ":ostream",
  84. "@llvm-project//llvm:Support",
  85. ],
  86. )
  87. cc_test(
  88. name = "error_test",
  89. srcs = ["error_test.cpp"],
  90. deps = [
  91. ":error",
  92. "//testing/base:gtest_main",
  93. "//testing/base:test_raw_ostream",
  94. "@com_google_googletest//:gtest",
  95. ],
  96. )
  97. cc_library(
  98. name = "indirect_value",
  99. hdrs = ["indirect_value.h"],
  100. )
  101. cc_test(
  102. name = "indirect_value_test",
  103. srcs = ["indirect_value_test.cpp"],
  104. deps = [
  105. ":indirect_value",
  106. "//testing/base:gtest_main",
  107. "@com_google_googletest//:gtest",
  108. ],
  109. )
  110. cc_library(
  111. name = "ostream",
  112. hdrs = ["ostream.h"],
  113. deps = [
  114. "@llvm-project//llvm:Support",
  115. ],
  116. )
  117. cc_library(
  118. name = "string_helpers",
  119. srcs = ["string_helpers.cpp"],
  120. hdrs = ["string_helpers.h"],
  121. deps = [
  122. ":check",
  123. ":error",
  124. "@llvm-project//llvm:Support",
  125. ],
  126. )
  127. cc_test(
  128. name = "string_helpers_test",
  129. srcs = ["string_helpers_test.cpp"],
  130. deps = [
  131. ":string_helpers",
  132. "//testing/base:gtest_main",
  133. "@com_google_googletest//:gtest",
  134. "@llvm-project//llvm:Support",
  135. ],
  136. )
  137. cc_library(
  138. name = "vlog",
  139. srcs = ["vlog_internal.h"],
  140. hdrs = ["vlog.h"],
  141. deps = [
  142. ":ostream",
  143. "@llvm-project//llvm:Support",
  144. ],
  145. )
  146. cc_test(
  147. name = "vlog_test",
  148. srcs = ["vlog_test.cpp"],
  149. deps = [
  150. ":vlog",
  151. "//testing/base:gtest_main",
  152. "//testing/base:test_raw_ostream",
  153. "@com_google_googletest//:gtest",
  154. ],
  155. )