BUILD 2.3 KB

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