From 07b982dd60e7ffdb7d1305083cd19e848cb8aa36 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Tue, 31 Jul 2018 19:21:20 -0500 Subject: [PATCH] Added compile option to build gcov data --- src/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 57e4b769f..4a62bcf5c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,6 +7,7 @@ option(SLIC3R_BUILD_TESTS "Build tests for libslic3r." ON) option(SLIC3R_STATIC "Build and link Slic3r statically." ON) option(BUILD_EXTRUDE_TIN "Build and link the extrude-tin application." OFF) option(PROFILE "Build with gprof profiling output." OFF) +option(COVERAGE "Build with gcov code coverage profiling." OFF) # only on newer GCCs: -ftemplate-backtrace-limit=0 add_compile_options(-DNO_PERL -Wall -DM_PI=3.14159265358979323846 -D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DBOOST_ASIO_DISABLE_KQUEUE) @@ -49,10 +50,13 @@ elseif (CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) add_compile_options(-g -O3) endif() -IF(PROFILE) +if(PROFILE) add_compile_options(-g -pg -DBUILD_PROFILE) endif(PROFILE) +if(COVERAGE) + add_compile_options(-g -ftest-coverage) +endif(COVERAGE) set(CMAKE_INCLUDE_CURRENT_DIR ON)