File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ if (NOT LLVM_COV_PATH)
8686 endif ()
8787 find_program (LLVM_COV_PATH ${LLVM_COV_NAME} )
8888endif ()
89+ find_program (GCOV_PATH gcov)
8990find_program (LCOV_PATH lcov)
9091find_program (GENHTML_PATH genhtml)
9192
@@ -301,11 +302,12 @@ function(target_code_coverage TARGET_NAME)
301302 add_custom_target (
302303 ccov-${TARGET_NAME}
303304 COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters
304- COMMAND $<TARGET_FILE:${TARGET_NAME} >
305+ COMMAND $<TARGET_FILE:${TARGET_NAME} > || true
305306 COMMAND ${LCOV_PATH}
306307 --directory ${CMAKE_BINARY_DIR}
307308 --capture
308309 --output -file ${COVERAGE_INFO}
310+ $<$<BOOL :${GCOV_PATH} >:--gcov-tool=${GCOV_PATH} >
309311 COMMAND ${EXCLUDE_COMMAND}
310312 COMMAND ${GENHTML_PATH} -o
311313 ${CMAKE_COVERAGE_OUTPUT_DIRECTORY} /${TARGET_NAME}
@@ -466,6 +468,7 @@ function(add_code_coverage_all_targets)
466468 --directory ${CMAKE_BINARY_DIR}
467469 --capture
468470 --output -file ${COVERAGE_INFO}
471+ $<$<BOOL :${GCOV_PATH} >:--gcov-tool=${GCOV_PATH} >
469472 COMMAND ${EXCLUDE_COMMAND}
470473 COMMAND ${GENHTML_PATH} -o
471474 ${CMAKE_COVERAGE_OUTPUT_DIRECTORY} /all -merged
You can’t perform that action at this time.
0 commit comments