summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2014-06-27 20:24:02 +0200
committerworktycho <work.tycho@gmail.com>2014-06-27 20:24:02 +0200
commitfb5d88b17ea3eb9102e5adbb5394b71bc142deb0 (patch)
tree82d820a3adc0d7e10e6b96bf0cb8fc1037130df1
parentCMake: pthread is used only on Unix. (diff)
parentAdded MSVC guard (diff)
downloadcuberite-fb5d88b17ea3eb9102e5adbb5394b71bc142deb0.tar
cuberite-fb5d88b17ea3eb9102e5adbb5394b71bc142deb0.tar.gz
cuberite-fb5d88b17ea3eb9102e5adbb5394b71bc142deb0.tar.bz2
cuberite-fb5d88b17ea3eb9102e5adbb5394b71bc142deb0.tar.lz
cuberite-fb5d88b17ea3eb9102e5adbb5394b71bc142deb0.tar.xz
cuberite-fb5d88b17ea3eb9102e5adbb5394b71bc142deb0.tar.zst
cuberite-fb5d88b17ea3eb9102e5adbb5394b71bc142deb0.zip
-rw-r--r--SetFlags.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/SetFlags.cmake b/SetFlags.cmake
index 290804fb6..339174e5c 100644
--- a/SetFlags.cmake
+++ b/SetFlags.cmake
@@ -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")