From 3d55a2befb10e85bbd9bf6d1b67467400efa2a35 Mon Sep 17 00:00:00 2001 From: "Pavel I. Kryukov" Date: Sat, 17 Apr 2021 22:44:50 +0300 Subject: [PATCH] Add coverage flags --- cmake/setup.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/setup.cmake b/cmake/setup.cmake index d55248d9..cc719cac 100644 --- a/cmake/setup.cmake +++ b/cmake/setup.cmake @@ -11,6 +11,8 @@ set(PUTTY_DEBUG OFF CACHE BOOL "Build PuTTY with debug() statements enabled") set(PUTTY_FUZZING OFF CACHE BOOL "Build PuTTY binaries suitable for fuzzing, NOT FOR REAL USE") +set(PUTTY_COVERAGE OFF + CACHE BOOL "Build PuTTY binaries suitable for code coverage analysis") set(STRICT OFF CACHE BOOL "Enable extra compiler warnings and make them errors") @@ -76,3 +78,6 @@ endif() if(PUTTY_FUZZING) add_compile_definitions(FUZZING) endif() +if(PUTTY_COVERAGE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage -g ") +endif()