summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-03-24 09:02:04 +0100
committerSébastien Helleu <flashcode@flashtux.org>2019-03-24 09:38:43 +0100
commit2612adf8993acf3925f636dd415921c4ff06727f (patch)
tree3fe7b92d60c759a7d8c542c40f1c9ce32913f113 /CMakeLists.txt
parent47c4329404e0b79731bdaff6ddd57c729bebf76b (diff)
downloadweechat-2612adf8993acf3925f636dd415921c4ff06727f.zip
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.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt72
1 files changed, 40 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f1a62fb9b..00016bc6a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,38 +82,46 @@ else()
set(INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})
endif()
-option(ENABLE_NCURSES "Compile the Ncurses interface" ON)
-option(ENABLE_HEADLESS "Compile the headless binary (required for tests)" ON)
-option(ENABLE_NLS "Enable Native Language Support" ON)
-option(ENABLE_GNUTLS "Enable SSLv3/TLS support" ON)
-option(ENABLE_LARGEFILE "Enable Large File Support" ON)
-option(ENABLE_ALIAS "Enable Alias plugin" ON)
-option(ENABLE_BUFLIST "Enable Buflist plugin" ON)
-option(ENABLE_CHARSET "Enable Charset plugin" ON)
-option(ENABLE_EXEC "Enable Exec plugin" ON)
-option(ENABLE_FIFO "Enable FIFO plugin" ON)
-option(ENABLE_FSET "Enable Fast Set plugin" ON)
-option(ENABLE_IRC "Enable IRC plugin" ON)
-option(ENABLE_LOGGER "Enable Logger plugin" ON)
-option(ENABLE_RELAY "Enable Relay plugin" ON)
-option(ENABLE_SCRIPT "Enable Script plugin (script manager)" ON)
-option(ENABLE_SCRIPTS "Enable script plugins (perl, python, ...)" ON)
-option(ENABLE_PERL "Enable Perl scripting language" ON)
-option(ENABLE_PYTHON "Enable Python scripting language" ON)
-option(ENABLE_PYTHON3 "Use Python 3.x if found (NOT recommended because many \"official\" scripts won't work)" OFF)
-option(ENABLE_RUBY "Enable Ruby scripting language" ON)
-option(ENABLE_LUA "Enable Lua scripting language" ON)
-option(ENABLE_TCL "Enable Tcl scripting language" ON)
-option(ENABLE_GUILE "Enable Scheme (guile) scripting language" ON)
-option(ENABLE_JAVASCRIPT "Enable JavaScript scripting language" ON)
-option(ENABLE_PHP "Enable PHP scripting language" ON)
-option(ENABLE_SPELL "Enable Spell checker plugin" ON)
-option(ENABLE_ENCHANT "Enable Enchant lib for Spell checker plugin" OFF)
-option(ENABLE_TRIGGER "Enable Trigger plugin" ON)
-option(ENABLE_XFER "Enable Xfer plugin" ON)
-option(ENABLE_MAN "Enable build of man page" OFF)
-option(ENABLE_DOC "Enable build of documentation" OFF)
-option(ENABLE_TESTS "Enable tests" OFF)
+option(ENABLE_NCURSES "Compile the Ncurses interface" ON)
+option(ENABLE_HEADLESS "Compile the headless binary (required for tests)" ON)
+option(ENABLE_NLS "Enable Native Language Support" ON)
+option(ENABLE_GNUTLS "Enable SSLv3/TLS support" ON)
+option(ENABLE_LARGEFILE "Enable Large File Support" ON)
+option(ENABLE_ALIAS "Enable Alias plugin" ON)
+option(ENABLE_BUFLIST "Enable Buflist plugin" ON)
+option(ENABLE_CHARSET "Enable Charset plugin" ON)
+option(ENABLE_EXEC "Enable Exec plugin" ON)
+option(ENABLE_FIFO "Enable FIFO plugin" ON)
+option(ENABLE_FSET "Enable Fast Set plugin" ON)
+option(ENABLE_IRC "Enable IRC plugin" ON)
+option(ENABLE_LOGGER "Enable Logger plugin" ON)
+option(ENABLE_RELAY "Enable Relay plugin" ON)
+option(ENABLE_SCRIPT "Enable Script plugin (script manager)" ON)
+option(ENABLE_SCRIPTS "Enable script plugins (perl, python, ...)" ON)
+option(ENABLE_PERL "Enable Perl scripting language" ON)
+option(ENABLE_PYTHON "Enable Python scripting language" ON)
+option(ENABLE_PYTHON3 "Use Python 3.x if found (NOT recommended because many \"official\" scripts won't work)" OFF)
+option(ENABLE_RUBY "Enable Ruby scripting language" ON)
+option(ENABLE_LUA "Enable Lua scripting language" ON)
+option(ENABLE_TCL "Enable Tcl scripting language" ON)
+option(ENABLE_GUILE "Enable Scheme (guile) scripting language" ON)
+option(ENABLE_JAVASCRIPT "Enable JavaScript scripting language" ON)
+option(ENABLE_PHP "Enable PHP scripting language" ON)
+option(ENABLE_SPELL "Enable Spell checker plugin" ON)
+option(ENABLE_ENCHANT "Enable Enchant lib for Spell checker plugin" OFF)
+option(ENABLE_TRIGGER "Enable Trigger plugin" ON)
+option(ENABLE_XFER "Enable Xfer plugin" ON)
+option(ENABLE_MAN "Enable build of man page" OFF)
+option(ENABLE_DOC "Enable build of documentation" OFF)
+option(ENABLE_TESTS "Enable tests" OFF)
+option(ENABLE_CODE_COVERAGE "Enable code coverage" OFF)
+
+# code coverage
+add_library(coverage_config INTERFACE)
+if(ENABLE_CODE_COVERAGE)
+ target_compile_options(coverage_config INTERFACE -O0 -g --coverage)
+ target_link_libraries(coverage_config INTERFACE --coverage)
+endif()
# headless mode is required for tests
if(ENABLE_TESTS AND NOT ENABLE_HEADLESS)