summaryrefslogtreecommitdiff
path: root/libcxx/CMakeLists.txt
diff options
context:
space:
mode:
authorNikolas Klauser <nikolasklauser@berlin.de>2022-08-13 22:33:12 +0200
committerNikolas Klauser <nikolasklauser@berlin.de>2022-12-23 15:42:13 +0100
commit841399a2188aaf244e83e3df7be66885ec905ede (patch)
tree0584ba9836530c245c45cf8537d4b26a1cdcffd4 /libcxx/CMakeLists.txt
parent0026874c8bd0616b520779b9fcfdb05e53ea4dca (diff)
downloadllvm-841399a2188aaf244e83e3df7be66885ec905ede.tar.gz
[libc++] Add custom clang-tidy checks
Reviewed By: #libc, ldionne Spies: jwakely, beanz, smeenai, cfe-commits, tschuett, avogelsgesang, Mordante, sstefan1, libcxx-commits, ldionne, mgorny, arichardson, miyuki Differential Revision: https://reviews.llvm.org/D131963
Diffstat (limited to 'libcxx/CMakeLists.txt')
-rw-r--r--libcxx/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 454caedcdf3f..eb71ae89f9fa 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -103,6 +103,7 @@ option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS
to provide compile-time errors when using features unavailable on some version of
the shared library they shipped should turn this on and see `include/__availability`
for more details." OFF)
+option(LIBCXX_ENABLE_CLANG_TIDY "Whether to compile and run clang-tidy checks" OFF)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-gcc.cfg.in")
@@ -928,6 +929,10 @@ if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
list(APPEND LIBCXX_TEST_DEPS cxx_external_threads)
endif()
+if (LIBCXX_ENABLE_CLANG_TIDY)
+ list(APPEND LIBCXX_TEST_DEPS cxx-tidy)
+endif()
+
if (LIBCXX_INCLUDE_BENCHMARKS)
add_subdirectory(benchmarks)
endif()