1
0
Fork 0

Merge pull request #1129 from mc-server/CodeCoverageCondition

Moved CodeCoverage into a separate cmake condition.
This commit is contained in:
worktycho 2014-06-27 19:24:02 +01:00
commit fb5d88b17e
1 changed files with 9 additions and 2 deletions

View File

@ -26,10 +26,17 @@ endmacro()
macro(set_flags)
# Add coverage processing, if requested:
if (NOT MSVC)
if (${CMAKE_BUILD_TYPE} STREQUAL "COVERAGE")
message("Including CodeCoverage")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cmake-coverage/")
include(CodeCoverage)
endif()
endif()
# Add the preprocessor macros used for distinguishing between debug and release builds (CMake does this automatically for MSVC):
if (NOT MSVC)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cmake-coverage/")
include(CodeCoverage)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} -D_DEBUG")