Глобальные настройки PVS-Studio

This commit is contained in:
Andrei Astafev 2020-10-02 08:37:25 +03:00
parent 186d67c4bb
commit 2be896c4a8
2 changed files with 14 additions and 0 deletions

View File

@ -15,6 +15,12 @@ function(add_pvs_check target)
ARGS --analysis-mode 29 --exclude-path ${CMAKE_CURRENT_BINARY_DIR}/${target}_autogen ARGS --analysis-mode 29 --exclude-path ${CMAKE_CURRENT_BINARY_DIR}/${target}_autogen
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)
add_dependencies(pvs-check pvs-check-${target}) add_dependencies(pvs-check pvs-check-${target})
configure_file("${CMLIB_MODULE_DIR}/hpp/pvs_studio.hpp.in" "${CMAKE_BINARY_DIR}/include/pvs_studio.hpp")
if(MSVC)
target_compile_options(${target} PRIVATE /FI "${CMAKE_BINARY_DIR}/include/pvs_studio.hpp")
else() # GCC/Clang
target_compile_options(${target} PRIVATE -include "${CMAKE_BINARY_DIR}/include/pvs_studio.hpp")
endif()
else() else()
message(STATUS "CMLIB warning:") message(STATUS "CMLIB warning:")
message(STATUS " PVS-Studio analyzer is not found") message(STATUS " PVS-Studio analyzer is not found")

8
hpp/pvs_studio.hpp.in Normal file
View File

@ -0,0 +1,8 @@
#ifndef PVS_STUDIO_HPP_
#define PVS_STUDIO_HPP_
#pragma once
//-V813_MINSIZE=33
#endif // PVS_STUDIO_HPP_