]> git.saurik.com Git - apt.git/commitdiff
CMake: Add coverage build type
authorJulian Andres Klode <jak@debian.org>
Sun, 11 Sep 2016 11:53:49 +0000 (13:53 +0200)
committerJulian Andres Klode <jak@debian.org>
Sun, 11 Sep 2016 11:53:49 +0000 (13:53 +0200)
This allows us to easily test coverage

CMakeLists.txt

index a26b32d71c1c031de71f44ea0e3dc45f62697762..39c1bcedcc8ce3c57a40cad08b7df6f90017e6f2 100644 (file)
@@ -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")