Skip to content

Commit

Permalink
[libc++][CMake] Adds option to disable clang-tidy.
Browse files Browse the repository at this point in the history
There have been some reports that always enabling clang-tidy (added in
llvm#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.
  • Loading branch information
mordante committed Jun 15, 2024
1 parent 47f8b85 commit 33699d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ option(LIBCXX_ENABLE_FILESYSTEM
available on the platform. This includes things like most parts of <filesystem> and
others like <fstream>" ON)
option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})
option(LIBCXX_DISABLE_CLANG_TIDY_TESTS
"Disables test using the clang-tidy plugin. This option should only be used
when autodetection fails, please file a bug report so the autodetection can
be improved." OFF)
set(LIBCXX_SUPPORTED_HARDENING_MODES none fast extensive debug)
set(LIBCXX_HARDENING_MODE "none" CACHE STRING
"Specify the default hardening mode to use. This mode will be used inside the
Expand Down
4 changes: 4 additions & 0 deletions libcxx/test/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
message(STATUS "Clang-tidy tests are disabled due to non-clang based compiler.")
return()
endif()
if(LIBCXX_DISABLE_CLANG_TIDY_TESTS)
message(STATUS "Clang-tidy tests are disabled by the configuration option LIBCXX_DISABLE_CLANG_TIDY_TESTS.")
return()
endif()
add_subdirectory(clang_tidy_checks)

0 comments on commit 33699d7

Please sign in to comment.