Use as many threads as cores for clang-tidy

This commit is contained in:
badaix 2025-02-09 19:56:32 +01:00
parent 9100119928
commit ea091483fb

View file

@ -6,9 +6,12 @@ if(CMAKE_VERSION VERSION_EQUAL "3.19.0" OR CMAKE_VERSION VERSION_GREATER
# If run-clang-tidy found
if(CLANG_TIDY)
include(ProcessorCount)
ProcessorCount(CPU_CORES)
add_custom_target(
clang-tidy
COMMAND ${CLANG_TIDY}
COMMAND ${CLANG_TIDY} -j ${CPU_CORES}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Static code analysis using ${CLANG_TIDY}")