aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2016-08-02 15:18:29 +0100
committerAndrew Lewis <nerf@judo.za.org>2016-08-02 15:18:29 +0100
commit924a4b40a8b681061d7f3e52c84ab75299d65cf4 (patch)
treea20ef764b57877c5e928938735b6f4ef0e776e09 /CMakeLists.txt
parent2b790c742f22060a6b1de90749c42f756e445000 (diff)
downloadrspamd-924a4b40a8b681061d7f3e52c84ab75299d65cf4.tar.gz
rspamd-924a4b40a8b681061d7f3e52c84ab75299d65cf4.zip
[Minor] Integrate coveralls
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd931fb83..802aa5a4e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,6 +61,7 @@ OPTION(ENABLE_HYPERSCAN "Enable hyperscan for fast regexp processing [default
OPTION(ENABLE_FANN "Enable fann for neural network plugin [default: OFF]" OFF)
OPTION(ENABLE_PCRE2 "Enable pcre2 instead of pcre [default: OFF]" OFF)
OPTION(ENABLE_JEMALLOC "Build rspamd with jemalloc allocator [default: OFF]" OFF)
+OPTION(ENABLE_COVERAGE "Build rspamd with code coverage options [default: OFF]" OFF)
INCLUDE(FindArch.cmake)
TARGET_ARCHITECTURE(ARCH)
@@ -823,6 +824,12 @@ IF(NOT CMAKE_C_OPT_FLAGS)
ENDIF(ENABLE_OPTIMIZATION MATCHES "ON")
ENDIF(NOT CMAKE_C_OPT_FLAGS)
+IF(ENABLE_COVERAGE)
+ SET(CMAKE_C_OPT_FLAGS "-g -O0 -fno-strict-aliasing")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
+ENDIF(ENABLE_COVERAGE)
+
SET(CMAKE_C_FLAGS "${CMAKE_C_OPT_FLAGS} ${CMAKE_C_FLAGS} ${CMAKE_C_WARN_FLAGS}")
ADD_DEFINITIONS(-DHAVE_CONFIG_H)