summaryrefslogtreecommitdiff
path: root/dbug/CMakeLists.txt
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2011-12-02 14:35:26 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2011-12-02 14:35:26 +0100
commit5beb816a7ec2e39d870f7fd3879dd5ac1e504e23 (patch)
treefa9d4577beb3cfbe5505c5e6c083c163c6957d08 /dbug/CMakeLists.txt
parent5d67eb6b5cc8d3643489acc39c545c0993d9777c (diff)
downloadmariadb-git-5beb816a7ec2e39d870f7fd3879dd5ac1e504e23.tar.gz
Make it possible to compile without SAFEMALLOC in debug builds
Default to no SAFEMALLOC on Windows, because C runtime malloc has this functionslity already
Diffstat (limited to 'dbug/CMakeLists.txt')
-rw-r--r--dbug/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/dbug/CMakeLists.txt b/dbug/CMakeLists.txt
index a4f30f75f97..0a9af25dba1 100644
--- a/dbug/CMakeLists.txt
+++ b/dbug/CMakeLists.txt
@@ -17,6 +17,17 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/dbug
${CMAKE_SOURCE_DIR}/include
)
+IF(WIN32)
+ SET(DEFAULT_SAFEMALLOC OFF)
+ELSE()
+ SET(DEFAULT_SAFEMALLOC ON)
+ENDIF()
+OPTION(WITH_SAFEMALLOC ${DEFAULT_SAFEMALLOC} "Use safemalloc for debug builds. Will result in slower execution.")
+
+IF(WITH_SAFEMALLOC)
+ ADD_DEFINITIONS( -DSAFEMALLOC)
+ENDIF()
+
SET(DBUG_SOURCES dbug.c)
ADD_CONVENIENCE_LIBRARY(dbug ${DBUG_SOURCES})
TARGET_LINK_LIBRARIES(dbug mysys)