From 422a2eba84361a8dfd84b549c13037512779c572 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 11 Sep 2016 13:53:49 +0200 Subject: [PATCH] CMake: Add coverage build type This allows us to easily test coverage --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a26b32d71..39c1bcedc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,11 @@ option(USE_NLS "Localisation support." ON) set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake") +# Add coverage target +set(CMAKE_CXX_FLAGS_COVERAGE "-g -fprofile-arcs -ftest-coverage") +set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "-lgcov") +set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "-lgcov") + # Work around bug in GNUInstallDirs if (EXISTS "/etc/debian_version") set(CMAKE_INSTALL_LIBEXECDIR "lib") -- 2.45.2