summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2015-04-10 06:15:06 -0400
committerJeff Hostetler <jeffhost@microsoft.com>2015-04-15 10:25:09 -0400
commitd06c589f486ebe9c96a9133bc8492844ad0cc6e8 (patch)
tree4e070b4ca2c03fa5f796e98af776bd1662426921 /CMakeLists.txt
parent47f37400253210f483d84fb9c2ecf44fb5986849 (diff)
downloadlibgit2-d06c589f486ebe9c96a9133bc8492844ad0cc6e8.tar.gz
Add MSVC CRTDBG memory leak reporting.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d64726e7f..5c3ba504c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,6 +74,11 @@ IF(WIN32)
OPTION( WINHTTP "Use Win32 WinHTTP routines" ON )
ENDIF()
+IF(MSVC)
+ # Enable MSVC CRTDBG memory leak reporting when in debug mode.
+ OPTION(MSVC_CRTDBG "Enable CRTDBG memory leak reporting" OFF)
+ENDIF()
+
# This variable will contain the libraries we need to put into
# libgit2.pc's Requires.private. That is, what we're linking to or
# what someone who's statically linking us needs to link to.
@@ -305,6 +310,10 @@ IF (MSVC)
SET(CRT_FLAG_RELEASE "/MD")
ENDIF()
+ IF (MSVC_CRTDBG)
+ SET(CRT_FLAG_DEBUG "${CRT_FLAG_DEBUG} /DGIT_MSVC_CRTDBG")
+ ENDIF()
+
# /Zi - Create debugging information
# /Od - Disable optimization
# /D_DEBUG - #define _DEBUG