Проверка с помощью PVS-Studio

This commit is contained in:
Andrei Astafev 2019-06-15 17:54:40 +03:00
parent adb244b474
commit 10567927a2

View File

@ -1,19 +1,18 @@
option(USE_PVS_STUDIO "Use PVS-Studio for static analysis" OFF) function(add_pvs_check)
list(GET ARGN 0 _target)
if(USE_PVS_STUDIO)
include(PVS-Studio) include(PVS-Studio)
find_program(PVS_STUDIO_ANALYZER_EXE NAMES pvs-studio-analyzer) find_program(PVS_STUDIO_ANALYZER_EXE NAMES pvs-studio-analyzer)
if(PVS_STUDIO_ANALYZER_EXE AND NOT TARGET pvs-global-checker) if(PVS_STUDIO_ANALYZER_EXE)
pvs_studio_add_target(TARGET pvs-global-checker pvs_studio_add_target(TARGET pvs-check
ALL DEPENDS ${_target}
RECURSIVE COMPILE_COMMANDS
HIDE_HELP HIDE_HELP
COMPILE_COMMANDS OUTPUT FORMAT errorfile
OUTPUT FORMAT errorfile CFG_TEXT "analysis-mode=29"
MODE GA:1,2,3;64:1;OP:1,2;CS:1,2 MODE GA:1,2,3;64:1;OP:1,2;CS:1,2)
LOG target.err)
else() else()
message(WARNING "PVS-Studio is not found") message(WARNING "PVS-Studio is not found")
endif() endif()
endif() endfunction()