2021-04-18 21:51:47 +02:00
|
|
|
if (NOT NPROC)
|
|
|
|
include(ProcessorCount)
|
|
|
|
ProcessorCount(NPROC)
|
|
|
|
if(NPROC EQUAL 0)
|
|
|
|
message(FATAL_ERROR "could not get processor count")
|
2020-04-02 13:55:49 +02:00
|
|
|
endif()
|
2021-04-18 21:51:47 +02:00
|
|
|
endif()
|
|
|
|
message(STATUS "NPROC=${NPROC}")
|
2020-04-02 13:55:49 +02:00
|
|
|
|
2021-10-24 11:07:45 +02:00
|
|
|
find_program(RUN_CLANG_TIDY NAMES run-clang-tidy run-clang-tidy-13 run-clang-tidy-12 run-clang-tidy-11 run-clang-tidy-10 run-clang-tidy-9 run-clang-tidy-8)
|
2021-04-18 21:51:47 +02:00
|
|
|
message(STATUS "RUN_CLANG_TIDY=${RUN_CLANG_TIDY}")
|
|
|
|
if (RUN_CLANG_TIDY)
|
|
|
|
# disable all compiler warnings since we are just interested in the tidy ones
|
2022-03-24 22:50:04 +01:00
|
|
|
add_custom_target(run-clang-tidy ${RUN_CLANG_TIDY} -checks=-performance-unnecessary-copy-initialization -p=${CMAKE_BINARY_DIR} -j ${NPROC} -extra-arg=-w -quiet)
|
2021-10-31 20:15:32 +01:00
|
|
|
if (BUILD_GUI)
|
|
|
|
add_dependencies(run-clang-tidy gui-build-deps)
|
|
|
|
if (BUILD_TESTS)
|
|
|
|
add_dependencies(run-clang-tidy triage-build-ui-deps)
|
|
|
|
endif()
|
|
|
|
endif()
|
2022-03-24 22:50:04 +01:00
|
|
|
endif()
|