From 2612adf8993acf3925f636dd415921c4ff06727f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 24 Mar 2019 09:02:04 +0100 Subject: core: add CMake option "ENABLE_CODE_COVERAGE" to compile with code coverage options This option is OFF by default and should be enabled only for tests, to measure test coverage. --- src/gui/CMakeLists.txt | 1 + src/gui/curses/headless/CMakeLists.txt | 2 +- src/gui/curses/normal/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index f94a05ba8..689624a60 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -43,6 +43,7 @@ set(LIB_GUI_COMMON_SRC include_directories(${CMAKE_BINARY_DIR}) add_library(weechat_gui_common STATIC ${LIB_GUI_COMMON_SRC}) +target_link_libraries(weechat_gui_common coverage_config) list(APPEND STATIC_LIBS weechat_gui_common) subdirs(curses) diff --git a/src/gui/curses/headless/CMakeLists.txt b/src/gui/curses/headless/CMakeLists.txt index 205628ccd..847bba612 100644 --- a/src/gui/curses/headless/CMakeLists.txt +++ b/src/gui/curses/headless/CMakeLists.txt @@ -51,7 +51,7 @@ add_executable(${EXECUTABLE} ${WEECHAT_CURSES_MAIN_HEADLESS_SRC}) add_dependencies(${EXECUTABLE} weechat_gui_headless weechat_ncurses_fake) # Due to circular references, we must link two times with libweechat_core.a and libweechat_gui_common.a -target_link_libraries(${EXECUTABLE} ${STATIC_LIBS} weechat_gui_headless weechat_ncurses_fake ${EXTRA_LIBS} ${STATIC_LIBS}) +target_link_libraries(${EXECUTABLE} ${STATIC_LIBS} weechat_gui_headless weechat_ncurses_fake ${EXTRA_LIBS} ${STATIC_LIBS} coverage_config) # Install executable install(TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin) diff --git a/src/gui/curses/normal/CMakeLists.txt b/src/gui/curses/normal/CMakeLists.txt index 760a21fb1..db9f5826a 100644 --- a/src/gui/curses/normal/CMakeLists.txt +++ b/src/gui/curses/normal/CMakeLists.txt @@ -57,7 +57,7 @@ add_dependencies(${EXECUTABLE} weechat_gui_curses_normal) list(APPEND EXTRA_LIBS ${NCURSES_LIBRARY}) # Due to circular references, we must link two times with libweechat_core.a and libweechat_gui_common.a -target_link_libraries(${EXECUTABLE} ${STATIC_LIBS} weechat_gui_curses_normal ${EXTRA_LIBS} ${STATIC_LIBS}) +target_link_libraries(${EXECUTABLE} ${STATIC_LIBS} weechat_gui_curses_normal ${EXTRA_LIBS} ${STATIC_LIBS} coverage_config) # Create a symbolic link weechat-curses -> weechat # This link is created for compatibility with old versions on /upgrade. -- cgit v1.2.3