Browse Source

ENH: Only compile memdebug when CURL_MALLOC_DEBUG is on

Andy Cedilnik 22 years ago
parent
commit
6e143754be
1 changed files with 8 additions and 1 deletions
  1. 8 1
      Source/CTest/Curl/CMakeLists.txt

+ 8 - 1
Source/CTest/Curl/CMakeLists.txt

@@ -59,7 +59,6 @@ SET(libCurl_SRCS
     easy.c
     security.c
     krb4.c
-    memdebug.c
     http_chunks.c
     strtok.c
     connect.c
@@ -69,6 +68,14 @@ SET(libCurl_SRCS
     content_encoding.c
     )
 
+OPTION(CURL_MALLOC_DEBUG "Debug mallocs in Curl" OFF)
+MARK_AS_ADVANCED(CURL_MALLOC_DEBUG)
+IF(CURL_MALLOC_DEBUG)
+  SET(libCurl_SRCS ${libCurl_SRCS}
+    memdebug.c
+  )
+ENDIF(CURL_MALLOC_DEBUG)
+
 # On windows preload settings
 #IF(WIN32)
 #  INCLUDE(${LIBCURL_SOURCE_DIR}/Platforms/WindowsCache.cmake)