summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2013-09-24 19:52:51 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2013-09-24 19:52:51 +0200
commit72dffd878e47e4fcfd224cadfea06caed0ac956b (patch)
tree7e7bfd20293d5f0e5f33769b543940009b924b04 /cmake
parent11fc6b49d96931d08bb8d266270014c0633a0fa5 (diff)
downloadmariadb-git-72dffd878e47e4fcfd224cadfea06caed0ac956b.tar.gz
MDEV-5062 : disable jemalloc by default everywhere, except Linux and OSX.
Bundled jemalloc can only be on Linux and OSX without problems. On BSDs, build fails because make does not understand GNU extensions (also BSDs do not need jemalloc, it is already system malloc). On Solaris, build fails with compile error.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/jemalloc.cmake14
1 files changed, 10 insertions, 4 deletions
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake
index fc7b2a73e72..bc6bf60781d 100644
--- a/cmake/jemalloc.cmake
+++ b/cmake/jemalloc.cmake
@@ -36,13 +36,19 @@ MACRO (USE_BUNDLED_JEMALLOC)
ADD_DEPENDENCIES(libjemalloc jemalloc)
ENDMACRO()
-SET(WITH_JEMALLOC "yes" CACHE STRING
+IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR APPLE)
+ # Linux and OSX are the only systems where bundled jemalloc can be built without problems,
+ # as they both have GNU make and jemalloc actually compiles.
+ # Also, BSDs use jemalloc as malloc already
+ SET(WITH_JEMALLOC_DEFAULT "yes")
+ELSE()
+ SET(WITH_JEMALLOC_DEFAULT "no")
+ENDIF()
+
+SET(WITH_JEMALLOC ${WITH_JEMALLOC_DEFAULT} CACHE STRING
"Which jemalloc to use (possible values are 'no', 'bundled', 'system', 'yes' (system if possible, otherwise bundled)")
MACRO (CHECK_JEMALLOC)
- IF(WIN32)
- SET(WITH_JEMALLOC "no")
- ENDIF()
IF(WITH_JEMALLOC STREQUAL "system" OR WITH_JEMALLOC STREQUAL "yes")
CHECK_LIBRARY_EXISTS(jemalloc malloc_stats_print "" HAVE_JEMALLOC)
IF (HAVE_JEMALLOC)