BUILD 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. package(default_visibility = ["//visibility:public"])
  5. cc_library(
  6. name = "bazel_working_dir",
  7. hdrs = ["bazel_working_dir.h"],
  8. deps = [
  9. "@llvm-project//llvm:Support",
  10. ],
  11. )
  12. cc_library(
  13. name = "check",
  14. srcs = ["check_internal.h"],
  15. hdrs = ["check.h"],
  16. deps = [
  17. "@llvm-project//llvm:Support",
  18. ],
  19. )
  20. cc_test(
  21. name = "check_test",
  22. srcs = ["check_test.cpp"],
  23. deps = [
  24. ":check",
  25. "//common:gtest_main",
  26. "@com_google_googletest//:gtest",
  27. ],
  28. )
  29. cc_library(
  30. name = "error",
  31. hdrs = ["error.h"],
  32. deps = [
  33. ":check",
  34. ":ostream",
  35. "@llvm-project//llvm:Support",
  36. ],
  37. )
  38. cc_test(
  39. name = "error_test",
  40. srcs = ["error_test.cpp"],
  41. deps = [
  42. ":error",
  43. "//common:gtest_main",
  44. "@com_google_googletest//:gtest",
  45. ],
  46. )
  47. # This does extra initialization on top of googletest's gtest_main in order to
  48. # provide stack traces on unexpected exits, because we normally rely on LLVM
  49. # code for that.
  50. #
  51. # This replaces "@com_google_googletest//:gtest_main";
  52. # "@com_google_googletest//:gtest" should still be used directly.
  53. cc_library(
  54. name = "gtest_main",
  55. testonly = 1,
  56. srcs = ["gtest_main.cpp"],
  57. deps = [
  58. "@com_google_googletest//:gtest",
  59. "@llvm-project//llvm:Support",
  60. ],
  61. )
  62. cc_library(
  63. name = "indirect_value",
  64. hdrs = ["indirect_value.h"],
  65. )
  66. cc_test(
  67. name = "indirect_value_test",
  68. srcs = ["indirect_value_test.cpp"],
  69. deps = [
  70. ":indirect_value",
  71. "//common:gtest_main",
  72. "@com_google_googletest//:gtest",
  73. ],
  74. )
  75. cc_library(
  76. name = "metaprogramming",
  77. hdrs = ["metaprogramming.h"],
  78. )
  79. cc_library(
  80. name = "ostream",
  81. hdrs = ["ostream.h"],
  82. deps = [
  83. ":metaprogramming",
  84. "@llvm-project//llvm:Support",
  85. ],
  86. )
  87. cc_library(
  88. name = "string_helpers",
  89. srcs = ["string_helpers.cpp"],
  90. hdrs = ["string_helpers.h"],
  91. deps = [
  92. ":check",
  93. ":error",
  94. "@llvm-project//llvm:Support",
  95. ],
  96. )
  97. cc_test(
  98. name = "string_helpers_test",
  99. srcs = ["string_helpers_test.cpp"],
  100. deps = [
  101. ":string_helpers",
  102. "//common:gtest_main",
  103. "@com_google_googletest//:gtest",
  104. "@llvm-project//llvm:Support",
  105. ],
  106. )