BUILD 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 = ["//explorer:__subpackages__"])
  6. cc_library(
  7. name = "arena",
  8. hdrs = ["arena.h"],
  9. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  10. # don't spend time linting it.
  11. tags = ["no-clang-tidy"],
  12. deps = [
  13. ":nonnull",
  14. "@llvm-project//llvm:Support",
  15. ],
  16. )
  17. cc_test(
  18. name = "arena_test",
  19. size = "small",
  20. srcs = ["arena_test.cpp"],
  21. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  22. # don't spend time linting it.
  23. tags = ["no-clang-tidy"],
  24. deps = [
  25. ":arena",
  26. "//testing/base:gtest_main",
  27. "@com_google_googletest//:gtest",
  28. ],
  29. )
  30. cc_library(
  31. name = "decompose",
  32. hdrs = ["decompose.h"],
  33. deps = [
  34. "@llvm-project//llvm:Support",
  35. ],
  36. )
  37. cc_test(
  38. name = "decompose_test",
  39. size = "small",
  40. srcs = ["decompose_test.cpp"],
  41. deps = [
  42. ":decompose",
  43. "//testing/base:gtest_main",
  44. "@com_google_googletest//:gtest",
  45. ],
  46. )
  47. cc_library(
  48. name = "error_builders",
  49. hdrs = ["error_builders.h"],
  50. deps = [
  51. ":source_location",
  52. "//common:error",
  53. ],
  54. )
  55. cc_test(
  56. name = "error_builders_test",
  57. size = "small",
  58. srcs = ["error_builders_test.cpp"],
  59. deps = [
  60. ":error_builders",
  61. ":source_location",
  62. "//testing/base:gtest_main",
  63. "//testing/base:test_raw_ostream",
  64. "@com_google_googletest//:gtest",
  65. ],
  66. )
  67. cc_library(
  68. name = "nonnull",
  69. hdrs = ["nonnull.h"],
  70. deps = [
  71. "//common:check",
  72. ],
  73. )
  74. cc_library(
  75. name = "print_as_id",
  76. hdrs = ["print_as_id.h"],
  77. deps = [
  78. "//common:ostream",
  79. ],
  80. )
  81. cc_library(
  82. name = "source_location",
  83. hdrs = ["source_location.h"],
  84. deps = [
  85. ":nonnull",
  86. "//common:ostream",
  87. ],
  88. )
  89. cc_library(
  90. name = "trace_stream",
  91. hdrs = ["trace_stream.h"],
  92. deps = [
  93. ":source_location",
  94. "//common:check",
  95. "//common:ostream",
  96. "//explorer/base:nonnull",
  97. "@llvm-project//llvm:Support",
  98. ],
  99. )
  100. cc_test(
  101. name = "set_program_phase_raii_test",
  102. size = "small",
  103. srcs = ["set_program_phase_raii_test.cpp"],
  104. deps = [
  105. ":trace_stream",
  106. "//testing/base:gtest_main",
  107. "@com_google_googletest//:gtest",
  108. ],
  109. )
  110. cc_test(
  111. name = "set_file_context_raii_test",
  112. size = "small",
  113. srcs = ["set_file_context_raii_test.cpp"],
  114. deps = [
  115. ":source_location",
  116. ":trace_stream",
  117. "//testing/base:gtest_main",
  118. "@com_google_googletest//:gtest",
  119. ],
  120. )