Commit cd077ca8 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-5026 cannot use system jemalloc

parent f89e6c44
......@@ -30,14 +30,23 @@ MACRO (USE_BUNDLED_JEMALLOC)
ENDMACRO()
SET(WITH_JEMALLOC "yes" CACHE STRING
"Which jemalloc to use (possible values are 'no', 'bundled', 'yes' (same as bundled)")
#"Which jemalloc to use (possible values are 'no', 'bundled', 'system', 'yes' (system if possible, otherwise bundled)")
"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 "bundled" OR WITH_JEMALLOC STREQUAL "yes")
IF(WITH_JEMALLOC STREQUAL "system" OR WITH_JEMALLOC STREQUAL "yes")
CHECK_LIBRARY_EXISTS(jemalloc malloc_stats_print "" HAVE_JEMALLOC)
IF (HAVE_JEMALLOC)
SET(LIBJEMALLOC jemalloc)
ELSEIF (WITH_JEMALLOC STREQUAL "system")
MESSAGE(FATAL_ERROR "system jemalloc is not found")
ELSEIF (WITH_JEMALLOC STREQUAL "yes")
SET(trybundled 1)
ENDIF()
ENDIF()
IF(WITH_JEMALLOC STREQUAL "bundled" OR trybundled)
USE_BUNDLED_JEMALLOC()
ENDIF()
ENDMACRO()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment