commit 6cedc4f: [Minor] Fix buid with no PVS

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Mar 13 16:49:04 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-03-13 16:43:55 +0000
URL: https://github.com/rspamd/rspamd/commit/6cedc4fe941b4db5f4a92735b4792490b26519ff (HEAD -> master)

[Minor] Fix buid with no PVS

---
 CMakeLists.txt | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e5fb9ece..ecd2440ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1414,8 +1414,12 @@ ENDIF(NOT DEBIAN_BUILD)
 
 
 # PVS Studio
-include(${CMAKE_SOURCE_DIR}/PVS-Studio.cmake)
-pvs_studio_add_target(TARGET ${PROJECT_NAME}.analyze
-		ANALYZE ${PROJECT_NAME} rspamd-server rspamadm rspamc
-		OUTPUT FORMAT errorfile
-		LOG target_${PROJECT_NAME}.err)
\ No newline at end of file
+find_program(_PVS_STUDIO "pvs-studio-analyzer")
+
+if(_PVS_STUDIO)
+	include(${CMAKE_SOURCE_DIR}/PVS-Studio.cmake)
+	pvs_studio_add_target(TARGET ${PROJECT_NAME}.analyze
+			ANALYZE ${PROJECT_NAME} rspamd-server rspamadm rspamc
+			OUTPUT FORMAT errorfile
+			LOG target_${PROJECT_NAME}.err)
+endif()
\ No newline at end of file


More information about the Commits mailing list