[llvm] [bazel] Add initial clang-doc config (PR #111779)
Keith Smiley via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 9 18:26:49 PDT 2024
https://github.com/keith created https://github.com/llvm/llvm-project/pull/111779
None
>From bc8c17436bbc5dd23ea6682812f1f38d2bd1b1fa Mon Sep 17 00:00:00 2001
From: Keith Smiley <keithbsmiley at gmail.com>
Date: Thu, 10 Oct 2024 01:26:11 +0000
Subject: [PATCH] [bazel] Add initial clang-doc config
---
.../clang-tools-extra/clang-doc/BUILD.bazel | 45 +++++++++++++++++++
.../clang-tools-extra/unittests/BUILD.bazel | 21 +++++++++
2 files changed, 66 insertions(+)
create mode 100644 utils/bazel/llvm-project-overlay/clang-tools-extra/clang-doc/BUILD.bazel
diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-doc/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-doc/BUILD.bazel
new file mode 100644
index 00000000000000..d7b9723b875c37
--- /dev/null
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-doc/BUILD.bazel
@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
+
+package(
+ default_visibility = ["//visibility:public"],
+ features = ["layering_check"],
+)
+
+licenses(["notice"])
+
+cc_library(
+ name = "lib",
+ srcs = glob(["*.cpp"]),
+ hdrs = glob(["*.h"]),
+ includes = ["."],
+ deps = [
+ "//clang:ast",
+ "//clang:basic",
+ "//clang:frontend",
+ "//clang:index",
+ "//clang:lex",
+ "//clang:tooling",
+ "//llvm:BitstreamReader",
+ "//llvm:BitstreamWriter",
+ "//llvm:Support",
+ ],
+)
+
+cc_binary(
+ name = "clang-doc",
+ srcs = ["tool/ClangDocMain.cpp"],
+ stamp = 0,
+ deps = [
+ ":lib",
+ "//clang:ast",
+ "//clang:ast_matchers",
+ "//clang:driver",
+ "//clang:frontend",
+ "//clang:tooling",
+ "//llvm:Support",
+ ],
+)
diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel
index 12e87cec4b76b8..47ec4552856416 100644
--- a/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel
@@ -53,3 +53,24 @@ cc_test(
"//third-party/unittest:gtest_main",
],
)
+
+cc_test(
+ name = "clang_doc_test",
+ size = "small",
+ srcs = glob(
+ [
+ "clang-doc/*.cpp",
+ "clang-doc/*.h",
+ ],
+ allow_empty = False,
+ ),
+ deps = [
+ "//clang:ast",
+ "//clang:basic",
+ "//clang-tools-extra/clang-doc:lib",
+ "//llvm:BitstreamReader",
+ "//llvm:BitstreamWriter",
+ "//third-party/unittest:gtest",
+ "//third-party/unittest:gtest_main",
+ ],
+)
More information about the llvm-commits
mailing list