diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-09-19 20:19:00 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-09-19 20:19:00 +0200 |
commit | cd077ca8396c369ded7df822e700714da1e13aa3 (patch) | |
tree | 3e42d46dcffe0797625516c48fbe3fdc8d89b547 /cmake | |
parent | f89e6c442cea2d6f220afe55284520ce26362729 (diff) | |
download | mariadb-git-cd077ca8396c369ded7df822e700714da1e13aa3.tar.gz |
MDEV-5026 cannot use system jemalloc
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/jemalloc.cmake | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake index 54e69da5a28..5cb9c493a20 100644 --- a/cmake/jemalloc.cmake +++ b/cmake/jemalloc.cmake @@ -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() |