]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: Add gcov --coverage flags when coverage option is set 57594/head
authorConnor Fawcett <connorfa@uk.ibm.com>
Tue, 21 May 2024 10:37:25 +0000 (11:37 +0100)
committerConnor Fawcett <connorfa@uk.ibm.com>
Wed, 29 May 2024 12:36:49 +0000 (13:36 +0100)
Signed-off-by: Connor Fawcett <connorfa@uk.ibm.com>
Fixes: https://tracker.ceph.com/issues/66158
CMakeLists.txt
src/CMakeLists.txt

index ba5798e0be9fe6142d6b5e21ee791d078d1bc8ea..62aaad94dc830cf328451fe8b318dd44b981b309 100644 (file)
@@ -637,7 +637,6 @@ if(WITH_BABELTRACE)
 endif(WITH_BABELTRACE)
 
 option(DEBUG_GATHER "C_Gather debugging is enabled" ON)
-option(ENABLE_COVERAGE "Coverage is enabled" OFF)
 option(PG_DEBUG_REFS "PG Ref debugging is enabled" OFF)
 
 option(WITH_TESTS "enable the build of ceph-test package scripts/binaries" ON)
index 4f8ea9593575f25d968c63949956051571ff0025..6cb049fb7b2ab65539da89c9eeaafc5363e67562 100644 (file)
@@ -263,15 +263,18 @@ if(LINUX OR APPLE)
   list(APPEND EXTRALIBS ${LIB_RESOLV})
 endif()
 
+option(ENABLE_COVERAGE "Coverage is enabled" OFF)
 if(${ENABLE_COVERAGE})
   find_program(HAVE_GCOV gcov)
   if(NOT HAVE_GCOV)
     message(FATAL_ERROR "Coverage Enabled but gcov Not Found")
   endif()
   add_compile_options(
-    -fprofile-arcs
-    -ftest-coverage
+    --coverage
     -O0)
+  add_link_options(
+    --coverage
+  )
   list(APPEND EXTRALIBS gcov)
 endif(${ENABLE_COVERAGE})