BUILD 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. "//toolchain/common:yaml_test_helpers",
  27. "//toolchain/diagnostics:diagnostic_emitter",
  28. "//toolchain/lexer:tokenized_buffer_test_helpers",
  29. "@com_google_googletest//:gtest_main",
  30. "@llvm-project//llvm:Support",
  31. ],
  32. )
  33. cc_fuzz_test(
  34. name = "driver_fuzzer",
  35. size = "small",
  36. srcs = ["driver_fuzzer.cpp"],
  37. corpus = glob(["fuzzer_corpus/*"]),
  38. deps = [
  39. ":driver",
  40. "@llvm-project//llvm:Support",
  41. ],
  42. )
  43. cc_binary(
  44. name = "carbon",
  45. srcs = ["driver_main.cpp"],
  46. deps = [
  47. ":driver",
  48. "@llvm-project//llvm:Support",
  49. ],
  50. )