From 2be896c4a83802f499bd8563e3d1041dc3b50153 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Fri, 2 Oct 2020 08:37:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=93=D0=BB=D0=BE=D0=B1=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D1=8B=D0=B5=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B8=20PVS-Studio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCodeAnalysisPvsStudio.cmake | 6 ++++++ hpp/pvs_studio.hpp.in | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 hpp/pvs_studio.hpp.in diff --git a/CMLibCodeAnalysisPvsStudio.cmake b/CMLibCodeAnalysisPvsStudio.cmake index fbec0f1..f60792c 100644 --- a/CMLibCodeAnalysisPvsStudio.cmake +++ b/CMLibCodeAnalysisPvsStudio.cmake @@ -15,6 +15,12 @@ function(add_pvs_check target) 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) 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() message(STATUS "CMLIB warning:") message(STATUS " PVS-Studio analyzer is not found") diff --git a/hpp/pvs_studio.hpp.in b/hpp/pvs_studio.hpp.in new file mode 100644 index 0000000..2b75d74 --- /dev/null +++ b/hpp/pvs_studio.hpp.in @@ -0,0 +1,8 @@ +#ifndef PVS_STUDIO_HPP_ +#define PVS_STUDIO_HPP_ + +#pragma once + +//-V813_MINSIZE=33 + +#endif // PVS_STUDIO_HPP_