if(NOT DEFINED PROJECT_CLANG_TIDY_CHECKS) set(PROJECT_CLANG_TIDY_CHECKS "-*,bugprone-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,performance-*,readability-*,-cppcoreguidelines-macro-usage,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-vararg,-modernize-use-trailing-return-type,-readability-braces-around-statements,-readability-identifier-length,-readability-implicit-bool-conversion,-readability-magic-numbers,-readability-string-compare") endif() if(NOT CMAKE_CROSSCOMPILING) find_program(CLANG_TIDY_EXE NAMES "clang-tidy") if(CLANG_TIDY_EXE) message(STATUS "clang-tidy: ${CLANG_TIDY_EXE}") message(STATUS "clang-tidy checks: ${PROJECT_CLANG_TIDY_CHECKS}") set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=${PROJECT_CLANG_TIDY_CHECKS}") set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=${PROJECT_CLANG_TIDY_CHECKS}") endif() endif()