[libcxx-commits] [PATCH] D141971: [libc++] Document how to build and run clang-tidy checks

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 17 15:02:24 PST 2023


philnik created this revision.
philnik added reviewers: ldionne, Mordante.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Getting clang-tidy to work can be a little bit more involved than most test utilies. This documents what is required to get clang-tidy working with system packages to make it a bit easier.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141971

Files:
  libcxx/docs/TestingLibcxx.rst


Index: libcxx/docs/TestingLibcxx.rst
===================================================================
--- libcxx/docs/TestingLibcxx.rst
+++ libcxx/docs/TestingLibcxx.rst
@@ -101,6 +101,27 @@
 - clang-query
 - clang-tidy
 
+Enabling clang-tidy checks
+--------------------------
+
+We have libc++-specific clang-tidy checks, which have to be compiled before running
+clang-tidy. Because of that, there are some additional requirements other than just
+having a recent clang-tidy version installed on the system.
+
+To compile clang-tidy checks, `-DLIBCXX_ENABLE_CLANG_TIDY=On` has to be passed to the
+CMake invocation used to compile libc++. For the CMake invocation and compiling libc++
+to succeed, the clang-tidy headers and binaries have to be available on the system.
+Here is an overview, which packages are required on a given system:
+
+============ ================================
+platform     required packages
+============ ================================
+Debian-based clang-tidy llvm-dev libclang-dev
+============ ================================
+
+With the listed packages installed, the clang-tidy checks should compile and the
+clang-tidy checks will get executed when running the libc++ tests.
+
 Writing Tests
 -------------
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141971.489951.patch
Type: text/x-patch
Size: 1253 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230117/e5e674d5/attachment.bin>


More information about the libcxx-commits mailing list