commit f5c0d71: [Minor] Support gcc static analyzer (from gcc 10)

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Apr 9 16:49:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-04-09 14:05:48 +0100
URL: https://github.com/rspamd/rspamd/commit/f5c0d7116e373fa48ab465e8d8dcae1ddaf44932

[Minor] Support gcc static analyzer (from gcc 10)

---
 cmake/Toolset.cmake | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/cmake/Toolset.cmake b/cmake/Toolset.cmake
index dc3c42ae4..9a2cb751e 100644
--- a/cmake/Toolset.cmake
+++ b/cmake/Toolset.cmake
@@ -138,6 +138,14 @@ if (COMPILER_GCC)
     set (CMAKE_CXX_FLAGS_RELEASE       "${CMAKE_CXX_FLAGS_RELEASE} -O3 ${COMPILER_FAST_MATH} -fomit-frame-pointer")
 
     if (ENABLE_FULL_DEBUG MATCHES "ON")
+        if (COMPILER_GCC)
+            # Check support of -fanalyzer
+            CHECK_C_COMPILER_FLAG(-fanalyzer SUPPORT_FANALYZER)
+            if (SUPPORT_FANALYZER)
+                set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fanalyzer")
+                set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fanalyzer")
+            endif()
+        endif ()
         set (CMAKE_C_FLAGS_DEBUG           "${CMAKE_C_FLAGS_DEBUG} -O0 ${COMPILER_DEBUG_FLAGS}")
         set (CMAKE_CXX_FLAGS_DEBUG         "${CMAKE_CXX_FLAGS_DEBUG} -O0 ${COMPILER_DEBUG_FLAGS}")
     else()


More information about the Commits mailing list