BUILD 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. load("@rules_python//python:defs.bzl", "py_binary")
  6. py_binary(
  7. name = "migrate_cpp",
  8. srcs = ["migrate_cpp.py"],
  9. data = [
  10. ":clang_tidy.yaml",
  11. "//migrate_cpp/cpp_refactoring",
  12. ],
  13. python_version = "PY3",
  14. )
  15. cc_library(
  16. name = "output_segment",
  17. hdrs = ["output_segment.h"],
  18. deps = [
  19. "//common:check",
  20. "@llvm-project//clang:ast",
  21. ],
  22. )
  23. cc_library(
  24. name = "rewriter",
  25. srcs = ["rewriter.cpp"],
  26. hdrs = ["rewriter.h"],
  27. visibility = [
  28. # For dependency checking. Remove once it has a binary using it.
  29. "//bazel/check_deps:__pkg__",
  30. ],
  31. deps = [
  32. ":output_segment",
  33. "//common:check",
  34. "@llvm-project//clang:ast",
  35. "@llvm-project//clang:basic",
  36. "@llvm-project//clang:frontend",
  37. "@llvm-project//clang:lex",
  38. "@llvm-project//clang:tooling",
  39. "@llvm-project//clang:tooling_core",
  40. "@llvm-project//llvm:Support",
  41. ],
  42. )
  43. cc_test(
  44. name = "rewriter_test",
  45. size = "small",
  46. srcs = ["rewriter_test.cpp"],
  47. deps = [
  48. ":rewriter",
  49. "//testing/base:gtest_main",
  50. "@googletest//:gtest",
  51. "@llvm-project//clang:ast",
  52. "@llvm-project//clang:frontend",
  53. "@llvm-project//clang:tooling",
  54. ],
  55. )