From c10fd9cd99402735e777cc4f6774e5b7265c372f Mon Sep 17 00:00:00 2001 From: navarrop Date: Thu, 25 Mar 2010 15:05:06 +0000 Subject: [PATCH] Enable code coverage by option. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7382 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- CMakeLists.txt | 3 +++ buildtools/Cmake/src/CMakeOption.txt | 1 + 2 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e7a65752d..6492dda369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,9 @@ set(INCLUDES "-I${PROJECT_DIRECTORY}/include -I${PROJECT_DIRECTORY}/src/include set(CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIRECTORY}) add_definitions (${INCLUDES}) +if(enable_coverage) +add_definitions (-fprofile-arcs -ftest-coverage) +endif(enable_coverage) ### Setup Options include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeOption.txt) diff --git a/buildtools/Cmake/src/CMakeOption.txt b/buildtools/Cmake/src/CMakeOption.txt index 067f1bbb27..3d4db3cda0 100644 --- a/buildtools/Cmake/src/CMakeOption.txt +++ b/buildtools/Cmake/src/CMakeOption.txt @@ -15,6 +15,7 @@ option(disable_ruby "This variable set ruby use." off) option(enable_compile_warnings "" off) option(enable_compile_optimizations "" off) option(enable_maintainer_mode "Permit to make flex and flexml files." off) +option(enable_coverage "Enable coverage." off) option(supernovae "Supernovae mode." off) mark_as_advanced(LUA_LIB_PATH_1) -- 2.30.2