BUILD 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 = "diagnostic_emitter",
  7. hdrs = ["diagnostic_emitter.h"],
  8. deps = [
  9. ":diagnostic_kind",
  10. "//common:check",
  11. "@llvm-project//llvm:Support",
  12. ],
  13. )
  14. cc_test(
  15. name = "diagnostic_emitter_test",
  16. size = "small",
  17. srcs = ["diagnostic_emitter_test.cpp"],
  18. deps = [
  19. ":diagnostic_emitter",
  20. ":mocks",
  21. "//common:gtest_main",
  22. "@com_google_googletest//:gtest",
  23. "@llvm-project//llvm:Support",
  24. ],
  25. )
  26. cc_library(
  27. name = "diagnostic_kind",
  28. srcs = ["diagnostic_kind.cpp"],
  29. hdrs = ["diagnostic_kind.h"],
  30. textual_hdrs = [
  31. "diagnostic_kind.def",
  32. ],
  33. deps = [
  34. "//common:enum_base",
  35. ],
  36. )
  37. cc_library(
  38. name = "null_diagnostics",
  39. hdrs = ["null_diagnostics.h"],
  40. deps = [
  41. ":diagnostic_emitter",
  42. "@llvm-project//llvm:Support",
  43. ],
  44. )
  45. cc_library(
  46. name = "sorting_diagnostic_consumer",
  47. hdrs = ["sorting_diagnostic_consumer.h"],
  48. deps = [
  49. ":diagnostic_emitter",
  50. "//common:check",
  51. "@llvm-project//llvm:Support",
  52. ],
  53. )
  54. cc_test(
  55. name = "sorting_diagnostic_consumer_test",
  56. size = "small",
  57. srcs = ["sorting_diagnostic_consumer_test.cpp"],
  58. deps = [
  59. ":diagnostic_emitter",
  60. ":mocks",
  61. ":sorting_diagnostic_consumer",
  62. "//common:gtest_main",
  63. "@com_google_googletest//:gtest",
  64. "@llvm-project//llvm:Support",
  65. ],
  66. )
  67. cc_library(
  68. name = "mocks",
  69. testonly = 1,
  70. srcs = ["mocks.cpp"],
  71. hdrs = ["mocks.h"],
  72. deps = [
  73. ":diagnostic_emitter",
  74. "@com_google_googletest//:gtest",
  75. "@llvm-project//llvm:Support",
  76. ],
  77. )