Skip to content

Commit 6af36e6

Browse files
keithDanielCChen
authored andcommitted
[bazel] Add initial clang-doc config (llvm#111779)
1 parent 48c5bfd commit 6af36e6

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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(["*.cpp"]),
17+
hdrs = glob(["*.h"]),
18+
includes = ["."],
19+
deps = [
20+
"//clang:ast",
21+
"//clang:basic",
22+
"//clang:frontend",
23+
"//clang:index",
24+
"//clang:lex",
25+
"//clang:tooling",
26+
"//llvm:BitstreamReader",
27+
"//llvm:BitstreamWriter",
28+
"//llvm:Support",
29+
],
30+
)
31+
32+
cc_binary(
33+
name = "clang-doc",
34+
srcs = ["tool/ClangDocMain.cpp"],
35+
stamp = 0,
36+
deps = [
37+
":lib",
38+
"//clang:ast",
39+
"//clang:ast_matchers",
40+
"//clang:driver",
41+
"//clang:frontend",
42+
"//clang:tooling",
43+
"//llvm:Support",
44+
],
45+
)

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,24 @@ cc_test(
5353
"//third-party/unittest:gtest_main",
5454
],
5555
)
56+
57+
cc_test(
58+
name = "clang_doc_test",
59+
size = "small",
60+
srcs = glob(
61+
[
62+
"clang-doc/*.cpp",
63+
"clang-doc/*.h",
64+
],
65+
allow_empty = False,
66+
),
67+
deps = [
68+
"//clang:ast",
69+
"//clang:basic",
70+
"//clang-tools-extra/clang-doc:lib",
71+
"//llvm:BitstreamReader",
72+
"//llvm:BitstreamWriter",
73+
"//third-party/unittest:gtest",
74+
"//third-party/unittest:gtest_main",
75+
],
76+
)

0 commit comments

Comments
 (0)