PVS Studio требует для работы CMAKE_EXPORT_COMPILE_COMMANDS

This commit is contained in:
Andrei Astafev 2019-06-26 11:46:53 +03:00
parent d9fde68239
commit bee451685f

View File

@ -1,6 +1,7 @@
function(add_pvs_check)
list(GET ARGN 0 _target)
if (CMAKE_EXPORT_COMPILE_COMMANDS)
include(PVS-Studio)
find_program(PVS_STUDIO_ANALYZER_EXE NAMES pvs-studio-analyzer)
if(PVS_STUDIO_ANALYZER_EXE)
@ -14,5 +15,8 @@ function(add_pvs_check)
else()
message(WARNING "PVS-Studio is not found")
endif()
else()
message(WARNING "Option CMAKE_EXPORT_COMPILE_COMMANDS is not set. PVS checks will be disabled.")
endif()
endfunction()