Skip to content

Commit 33699d7

Browse files
committed
[libc++][CMake] Adds option to disable clang-tidy.
There have been some reports that always enabling clang-tidy (added in #90077) has some false positives in the detection. It would be good to fix these. This adds an escape hatch to disable the tests, which avoids blocking users with this issue.
1 parent 47f8b85 commit 33699d7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

libcxx/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ option(LIBCXX_ENABLE_FILESYSTEM
6060
available on the platform. This includes things like most parts of <filesystem> and
6161
others like <fstream>" ON)
6262
option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})
63+
option(LIBCXX_DISABLE_CLANG_TIDY_TESTS
64+
"Disables test using the clang-tidy plugin. This option should only be used
65+
when autodetection fails, please file a bug report so the autodetection can
66+
be improved." OFF)
6367
set(LIBCXX_SUPPORTED_HARDENING_MODES none fast extensive debug)
6468
set(LIBCXX_HARDENING_MODE "none" CACHE STRING
6569
"Specify the default hardening mode to use. This mode will be used inside the

libcxx/test/tools/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
55
message(STATUS "Clang-tidy tests are disabled due to non-clang based compiler.")
66
return()
77
endif()
8+
if(LIBCXX_DISABLE_CLANG_TIDY_TESTS)
9+
message(STATUS "Clang-tidy tests are disabled by the configuration option LIBCXX_DISABLE_CLANG_TIDY_TESTS.")
10+
return()
11+
endif()
812
add_subdirectory(clang_tidy_checks)

0 commit comments

Comments
 (0)