PVS Studio требует для работы CMAKE_EXPORT_COMPILE_COMMANDS
This commit is contained in:
parent
d9fde68239
commit
bee451685f
@ -1,18 +1,22 @@
|
||||
function(add_pvs_check)
|
||||
list(GET ARGN 0 _target)
|
||||
|
||||
include(PVS-Studio)
|
||||
find_program(PVS_STUDIO_ANALYZER_EXE NAMES pvs-studio-analyzer)
|
||||
if(PVS_STUDIO_ANALYZER_EXE)
|
||||
pvs_studio_add_target(TARGET pvs-check-${_target}
|
||||
DEPENDS ${_target}
|
||||
COMPILE_COMMANDS
|
||||
HIDE_HELP
|
||||
OUTPUT FORMAT errorfile
|
||||
CFG_TEXT "analysis-mode=29"
|
||||
MODE GA:1,2,3;64:1;OP:1,2;CS:1,2)
|
||||
if (CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||
include(PVS-Studio)
|
||||
find_program(PVS_STUDIO_ANALYZER_EXE NAMES pvs-studio-analyzer)
|
||||
if(PVS_STUDIO_ANALYZER_EXE)
|
||||
pvs_studio_add_target(TARGET pvs-check-${_target}
|
||||
DEPENDS ${_target}
|
||||
COMPILE_COMMANDS
|
||||
HIDE_HELP
|
||||
OUTPUT FORMAT errorfile
|
||||
CFG_TEXT "analysis-mode=29"
|
||||
MODE GA:1,2,3;64:1;OP:1,2;CS:1,2)
|
||||
else()
|
||||
message(WARNING "PVS-Studio is not found")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "PVS-Studio is not found")
|
||||
message(WARNING "Option CMAKE_EXPORT_COMPILE_COMMANDS is not set. PVS checks will be disabled.")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user