summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-08-09 15:59:32 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-08-09 15:59:32 (GMT)
commit01c9aa1e76857bf22771342dadf87af08979aa33 (patch)
tree6d361ba9040e4126ae1a4095dc3db748393e046f /CMakeLists.txt
parentb5c6121a5d288264f9207fa48cbb132715ea546a (diff)
downloadhdf5-01c9aa1e76857bf22771342dadf87af08979aa33.zip
hdf5-01c9aa1e76857bf22771342dadf87af08979aa33.tar.gz
hdf5-01c9aa1e76857bf22771342dadf87af08979aa33.tar.bz2
Update Drop Site options and Coverage settings
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb860d2..4cdb31c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -443,9 +443,14 @@ endif ()
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF)
if (HDF5_ENABLE_COVERAGE)
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
- set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage")
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
+ link_libraries (gcov)
+ else ()
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
+ endif ()
endif ()
#-----------------------------------------------------------------------------