BUILD 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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("//bazel/fuzzing:rules.bzl", "cc_fuzz_test")
  5. package(default_visibility = ["//visibility:public"])
  6. cc_library(
  7. name = "driver",
  8. srcs = ["driver.cpp"],
  9. hdrs = ["driver.h"],
  10. textual_hdrs = ["flags.def"],
  11. deps = [
  12. "//toolchain/diagnostics:diagnostic_emitter",
  13. "//toolchain/diagnostics:sorting_diagnostic_consumer",
  14. "//toolchain/lexer:tokenized_buffer",
  15. "//toolchain/parser:parse_tree",
  16. "//toolchain/source:source_buffer",
  17. "@llvm-project//llvm:Support",
  18. ],
  19. )
  20. cc_test(
  21. name = "driver_test",
  22. size = "small",
  23. srcs = ["driver_test.cpp"],
  24. deps = [
  25. ":driver",
  26. "//common:gtest_main",
  27. "//toolchain/common:yaml_test_helpers",
  28. "//toolchain/diagnostics:diagnostic_emitter",
  29. "//toolchain/lexer:tokenized_buffer_test_helpers",
  30. "@com_google_googletest//:gtest",
  31. "@llvm-project//llvm:Support",
  32. ],
  33. )
  34. cc_fuzz_test(
  35. name = "driver_fuzzer",
  36. size = "small",
  37. srcs = ["driver_fuzzer.cpp"],
  38. corpus = glob(["fuzzer_corpus/*"]),
  39. deps = [
  40. ":driver",
  41. "@llvm-project//llvm:Support",
  42. ],
  43. )
  44. cc_binary(
  45. name = "carbon",
  46. srcs = ["driver_main.cpp"],
  47. deps = [
  48. ":driver",
  49. "@llvm-project//llvm:Support",
  50. ],
  51. )