From bccb344412a0e97afdf0aaaf41a31124c84f6eaa Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 11 Sep 2016 13:58:40 +0200 Subject: Coverage: Do not print messages from gcov We need to ignore messages from gcov. All those messages start with profiling: and are printed using vfprintf(), so the only thing we can do is add a library overriding those functions and linking apt-pkg to it. --- apt-pkg/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apt-pkg/CMakeLists.txt') diff --git a/apt-pkg/CMakeLists.txt b/apt-pkg/CMakeLists.txt index bdaa93d67..1b493c819 100644 --- a/apt-pkg/CMakeLists.txt +++ b/apt-pkg/CMakeLists.txt @@ -49,3 +49,7 @@ add_version_script(apt-pkg) install(TARGETS apt-pkg LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/apt-pkg) flatify(${PROJECT_BINARY_DIR}/include/apt-pkg/ "${headers}") + +if(CMAKE_BUILD_TYPE STREQUAL "Coverage") + target_link_libraries(apt-pkg PUBLIC noprofile) +endif() -- cgit v1.2.3