aboutsummaryrefslogtreecommitdiffstats
path: root/host/CMakeLists.txt
diff options
context:
space:
mode:
authorAndrej Rode <andrej.rode@ettus.com>2017-04-26 10:27:43 -0700
committerMartin Braun <martin.braun@ettus.com>2017-05-23 17:40:35 -0700
commit13a3e48e2d8e83b69bad85d01763d063349b52bc (patch)
treea2aa1ee1ce8704be996a838b08e6d3addb0a84d9 /host/CMakeLists.txt
parentb082aa444c126703980eb973c476767dce80c3ed (diff)
downloaduhd-13a3e48e2d8e83b69bad85d01763d063349b52bc.tar.gz
uhd-13a3e48e2d8e83b69bad85d01763d063349b52bc.tar.bz2
uhd-13a3e48e2d8e83b69bad85d01763d063349b52bc.zip
cmake: add coverage target
Diffstat (limited to 'host/CMakeLists.txt')
-rw-r--r--host/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index 21706d580..6e4e7d6cc 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -225,6 +225,12 @@ IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR
UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN)
UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-fvisibility-inlines-hidden HAVE_VISIBILITY_INLINES_HIDDEN)
ENDIF(NOT WIN32)
+ IF(${CMAKE_BUILD_TYPE} STREQUAL "Coverage")
+ include(CodeCoverage)
+ setup_target_for_coverage(coverage "ctest || return 0" coverage) # never fail ctest, always generate coverage report
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING "Flags used by the C++ compiler during Coverage builds." FORCE)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING "Flags used by the C compiler during Coverage builds." FORCE)
+ ENDIF()
ENDIF()
IF(MSVC)