From 8a2df7ac4d2e421f04f4750b6392b7c877461d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 4 Apr 2014 13:24:35 +0200 Subject: [PATCH] Add a build option to compile with gcov support New build option KWIN_BUILD_COVERAGE which adds "-fprofile-arcs -ftest-coverage" to CMAKE_CXX_FLAGS and "-lgcov" to CMAKE_EXE_LINKER_FLAGS. REVIEW: 117369 --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35fb9ac3b0..e9228e8199 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,6 +143,13 @@ option(KWIN_BUILD_XRENDER_COMPOSITING "Enable building of KWin with XRender Comp cmake_dependent_option(KWIN_BUILD_ACTIVITIES "Enable building of KWin with kactivities support" ON "KF5Activities_FOUND" OFF) option(KWIN_PLASMA_ACTIVE "Enable building KWin for Plasma Active." OFF) +option(KWIN_BUILD_COVERAGE "Build KWin with gcov support" OFF) + +if(KWIN_BUILD_COVERAGE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov") +endif() + # Binary name of KWin set(KWIN_NAME "kwin") set(KWIN_VERSION_MAJOR 4)