BUILD 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 = "diagnostic_emitter",
  8. srcs = ["diagnostic_emitter.cpp"],
  9. hdrs = ["diagnostic_emitter.h"],
  10. deps = ["@llvm-project//llvm:Support"],
  11. )
  12. cc_library(
  13. name = "null_diagnostics",
  14. hdrs = ["null_diagnostics.h"],
  15. deps = [
  16. ":diagnostic_emitter",
  17. "@llvm-project//llvm:Support",
  18. ],
  19. )
  20. cc_library(
  21. name = "mocks",
  22. testonly = 1,
  23. hdrs = ["mocks.h"],
  24. deps = [
  25. ":diagnostic_emitter",
  26. "@llvm-project//llvm:Support",
  27. "@llvm-project//llvm:gmock",
  28. ],
  29. )
  30. cc_test(
  31. name = "diagnostic_emitter_test",
  32. srcs = ["diagnostic_emitter_test.cpp"],
  33. deps = [
  34. ":diagnostic_emitter",
  35. ":mocks",
  36. "@llvm-project//llvm:Support",
  37. "@llvm-project//llvm:gmock",
  38. "@llvm-project//llvm:gtest",
  39. "@llvm-project//llvm:gtest_main",
  40. ],
  41. )