diff --git a/cmake/clang-tidy.cmake b/cmake/clang-tidy.cmake index f9d3e122..a8fc3d2e 100644 --- a/cmake/clang-tidy.cmake +++ b/cmake/clang-tidy.cmake @@ -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}")