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
+3 -1
View File
@@ -22,6 +22,8 @@ set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
include(utils.cmake)
include(CTest)
option(KYTY_ENABLE_CLANG_TIDY "Run clang-tidy checks during builds" OFF)
set(KYTY_THIRD_PARTY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
@@ -129,7 +131,7 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0.0)
common
#launcher
)
list(APPEND KYTY_CLANG_TYDY
list(APPEND KYTY_CLANG_TIDY
kyty_emulator
#common
launcher
+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}")