BUILD 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. srcs = ["rewriter_test.cpp"],
  46. deps = [
  47. ":rewriter",
  48. "//testing/base:gtest_main",
  49. "@com_google_googletest//:gtest",
  50. "@llvm-project//clang:ast",
  51. "@llvm-project//clang:frontend",
  52. "@llvm-project//clang:tooling",
  53. ],
  54. )