build: make clang-tidy checks opt-in

This commit is contained in:
nmzik
2026-07-27 16:33:22 +02:00
parent f60f80b631
commit c71bb9fc9e
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ function(include_what_you_use_with_mappings target dirs mappings)
endfunction()
function(clang_tidy_check target config headers dirs)
if (CLANG AND ("${target}" IN_LIST KYTY_CLANG_TYDY) AND NOT KYTY_CLANG_CL)
if (KYTY_ENABLE_CLANG_TIDY AND CLANG AND ("${target}" IN_LIST KYTY_CLANG_TIDY) AND NOT KYTY_CLANG_CL)
find_program (CLANG_TIDY_EXE NAMES "clang-tidy")
if (CLANG_TIDY_EXE)
set(std_arg "-extra-arg=-std=c++${CMAKE_CXX_STANDARD}")
@@ -41,7 +41,7 @@ function(clang_tidy_check target config headers dirs)
endfunction()
function(clang_tidy_fix target config headers dirs)
if (CLANG AND ("${target}" IN_LIST KYTY_CLANG_TYDY))
if (KYTY_ENABLE_CLANG_TIDY AND CLANG AND ("${target}" IN_LIST KYTY_CLANG_TIDY))
find_program (CLANG_TIDY_EXE NAMES "clang-tidy")
if (CLANG_TIDY_EXE)
set(std_arg "-extra-arg=-std=c++${CMAKE_CXX_STANDARD}")