[clang-tools-extra] [clang-doc] create a separate cmake file for clang-doc's LIT tests (PR #165935)

Erick Velez via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 31 15:51:01 PDT 2025


https://github.com/evelez7 created https://github.com/llvm/llvm-project/pull/165935

To avoid depending on all of the tools in clang-tools-extra, the
`check-clang-extra-clang-doc` target is specialized in its own CMake
file in clang-tools-extra/test/clang-doc. This eliminates around 800
files to be processed when building that target, plus linking every
tool.

>From 5cf10307e3db0abe20c3e5799ff85496a2c28a99 Mon Sep 17 00:00:00 2001
From: Erick Velez <erickvelez7 at gmail.com>
Date: Fri, 31 Oct 2025 15:46:54 -0700
Subject: [PATCH] [clang-doc] create a separate cmake file for clang-doc's LIT
 tests

To avoid depending on all of the tools in clang-tools-extra, the
`check-clang-extra-clang-doc` target is specialized in its own CMake
file in clang-tools-extra/test/clang-doc. This eliminates around 800
files to be processed when building that target, plus linking every
tool.
---
 clang-tools-extra/test/CMakeLists.txt           | 3 +++
 clang-tools-extra/test/clang-doc/CMakeLists.txt | 6 ++++++
 2 files changed, 9 insertions(+)
 create mode 100644 clang-tools-extra/test/clang-doc/CMakeLists.txt

diff --git a/clang-tools-extra/test/CMakeLists.txt b/clang-tools-extra/test/CMakeLists.txt
index a70d2ef2d92f2..78447e7a00db8 100644
--- a/clang-tools-extra/test/CMakeLists.txt
+++ b/clang-tools-extra/test/CMakeLists.txt
@@ -87,4 +87,7 @@ add_lit_testsuite(check-clang-extra "Running clang-tools-extra/test"
 
 add_lit_testsuites(CLANG-EXTRA ${CMAKE_CURRENT_SOURCE_DIR}
   DEPENDS ${CLANG_TOOLS_TEST_DEPS}
+   SKIP "^clang-doc"
   )
+
+add_subdirectory(clang-doc)
diff --git a/clang-tools-extra/test/clang-doc/CMakeLists.txt b/clang-tools-extra/test/clang-doc/CMakeLists.txt
new file mode 100644
index 0000000000000..fd2230660bdef
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Specialize the clang-doc target to avoid building other projects
+add_lit_testsuite(check-clang-extra-clang-doc "Running clang-doc tests"
+  ${CMAKE_CURRENT_BINARY_DIR}
+  DEPENDS clang-doc
+  DEPENDS ${LLVM_UTILS_DEPS}
+)



More information about the cfe-commits mailing list