Skip to content

Commit c3715ec

Browse files
authored
[bazel] Add clang-apply-replacements BUILD file (llvm#138054)
1 parent 708053c commit c3715ec

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2+
# See https://llvm.org/LICENSE.txt for license information.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
6+
7+
package(
8+
default_visibility = ["//visibility:public"],
9+
features = ["layering_check"],
10+
)
11+
12+
licenses(["notice"])
13+
14+
cc_library(
15+
name = "lib",
16+
srcs = glob(["lib/**/*.cpp"]),
17+
hdrs = glob(["include/clang-apply-replacements/**/*.h"]),
18+
includes = ["include"],
19+
deps = [
20+
"//clang:basic",
21+
"//clang:format",
22+
"//clang:lex",
23+
"//clang:rewrite",
24+
"//clang:tooling",
25+
"//clang:tooling_core",
26+
"//clang:tooling_refactoring",
27+
"//llvm:Support",
28+
],
29+
)
30+
31+
cc_binary(
32+
name = "clang-apply-replacements",
33+
srcs = glob([
34+
"tool/*.cpp",
35+
]),
36+
deps = [
37+
":lib",
38+
"//clang:basic",
39+
"//clang:format",
40+
"//clang:rewrite",
41+
"//llvm:Support",
42+
],
43+
)

utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,14 @@ cc_test(
7474
"//third-party/unittest:gtest_main",
7575
],
7676
)
77+
78+
cc_test(
79+
name = "clang_apply_replacements_test",
80+
srcs = glob(["clang-apply-replacements/**/*.cpp"]),
81+
deps = [
82+
"//clang:format",
83+
"//clang-tools-extra/clang-apply-replacements:lib",
84+
"//third-party/unittest:gtest",
85+
"//third-party/unittest:gtest_main",
86+
],
87+
)

0 commit comments

Comments
 (0)