Skip to content
Snippets Groups Projects
Commit 90c9ae39 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

cmake: add coverage option

This allow to get coverage reports from ctest.
e.g.
    $ ctest -R typers -T test -T coverage

Change-Id: Ic7d1bf5d7d641f1e581e4855bbc923ee5d8994b5
parent cab0ba62
Branches
No related tags found
No related merge requests found
......@@ -21,6 +21,8 @@ option(JAMI_VIDEO_ACCEL "Build video hardware acceleration support" ON)
option(BUILD_CONTRIB "Build contrib to CONTRIB_PATH" ON)
option(BUILD_EXTRA_TOOLS "Build extra tools" OFF)
option(ENABLE_ASAN "Enable address sanitization" OFF)
option(ENABLE_COVERAGE "Enable coverage (for tests)" OFF)
if(ENABLE_ASAN AND NOT MSVC)
message(STATUS "Address sanitization enabled for daemon")
# Add AddressSanitizer flags for both compiler and linker
......@@ -28,6 +30,10 @@ if(ENABLE_ASAN AND NOT MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif()
if(ENABLE_COVERAGE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
endif()
include(CTest)
if(NOT MSVC)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment