diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index 4b927017f8c2a..9a35ff30114cd 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -60,6 +60,10 @@ option(LIBCXX_ENABLE_FILESYSTEM available on the platform. This includes things like most parts of and others like " 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 diff --git a/libcxx/test/tools/CMakeLists.txt b/libcxx/test/tools/CMakeLists.txt index 6d99c53ad46d9..801e45521edb8 100644 --- a/libcxx/test/tools/CMakeLists.txt +++ b/libcxx/test/tools/CMakeLists.txt @@ -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)