summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2009-09-30 15:35:01 +0200
committerVladislav Vaintroub <vvaintroub@mysql.com>2009-09-30 15:35:01 +0200
commiteaba74fee5611369c02e50eb6da707f8f29cf302 (patch)
tree7f9c3b3991fa7d5f18931f146c63848ea7405fd6 /CMakeLists.txt
parentb73763e0f913a1b3e841cbe91f9d11802cbf054c (diff)
downloadmariadb-git-eaba74fee5611369c02e50eb6da707f8f29cf302.tar.gz
Backport http://lists.mysql.com/commits/57778
2677 Vladislav Vaintroub 2008-11-04 CMakeLists.txt files cleanup - remove SAFEMALLOC and SAFE_MUTEX definitions that were present in *each* CMakeLists.txt. Instead, put them into top level CMakeLists.txt, but disable on Windows, because a) SAFEMALLOC does not add any functionality that is not already present in Debug C runtime ( and 2 safe malloc one on top of the other only unnecessarily slows down the server) b)SAFE_MUTEX does not work on Windows and have been explicitely disabled on Windows with #undef previously. Fortunately, ntdll does pretty good job identifying l problems with CRITICAL_SECTIONs. DebugBreak()s on using uninited critical section, unlocking unowned critical section) -Also, remove occationally used -D_DEBUG (added by compiler anyway) sql/udf_example.c: use unixish end of line
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-xCMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fba26ec1464..5f2474eaaf8 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,13 @@ ADD_DEFINITIONS(-DSHAREDIR="share")
# Set debug options
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS")
+# Do not use SAFEMALLOC for Windows builds, as Debug CRT has the same functionality
+# Neither SAFE_MUTEX works on Windows and it has been explicitely undefined in
+# my_pthread.h
+IF(NOT WIN32)
+ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+ENDIF(NOT WIN32)
SET(localstatedir "C:\\mysql\\data")
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-huge.cnf.sh