aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-09 14:05:48 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-09 14:05:48 +0100
commitf5c0d7116e373fa48ab465e8d8dcae1ddaf44932 (patch)
treee20333b0816c766c46536691490b618d1fbd7d39
parent201f4fdeb20444ccf6dd5474d596cf6227badb37 (diff)
downloadrspamd-f5c0d7116e373fa48ab465e8d8dcae1ddaf44932.tar.gz
rspamd-f5c0d7116e373fa48ab465e8d8dcae1ddaf44932.zip
[Minor] Support gcc static analyzer (from gcc 10)
-rw-r--r--cmake/Toolset.cmake8
1 files changed, 8 insertions, 0 deletions
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()