]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Support gcc static analyzer (from gcc 10)
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Apr 2020 13:05:48 +0000 (14:05 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Apr 2020 13:05:48 +0000 (14:05 +0100)
cmake/Toolset.cmake

index dc3c42ae4d8d03cc5e89fe5eb90e6791ee39bdcd..9a2cb751ea831bf30d348f137b5dc1b1d570e41c 100644 (file)
@@ -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()