2019-06-27 15:13:19 +00:00
if ( OS_LINUX AND NOT SANITIZE AND NOT ARCH_ARM AND NOT ARCH_32 AND NOT ARCH_PPC64LE )
2019-07-15 17:00:18 +00:00
option ( ENABLE_MIMALLOC "Set to FALSE to disable usage of mimalloc for internal ClickHouse caches" FALSE )
2019-06-27 15:13:19 +00:00
endif ( )
if ( NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/mimalloc/include/mimalloc.h" )
2019-06-28 18:06:09 +00:00
message ( WARNING "submodule contrib/mimalloc is missing. to fix try run: \n git submodule update --init --recursive" )
return ( )
2019-06-27 15:13:19 +00:00
endif ( )
if ( ENABLE_MIMALLOC )
2019-07-15 19:21:37 +00:00
message ( FATAL_ERROR "Mimalloc is not production ready. (Disable with cmake -D ENABLE_MIMALLOC=0). If you want to use mimalloc, you must manually remove this message." )
2019-06-27 15:13:19 +00:00
set ( MIMALLOC_INCLUDE_DIR ${ ClickHouse_SOURCE_DIR } /contrib/mimalloc/include )
set ( USE_MIMALLOC 1 )
set ( MIMALLOC_LIBRARY mimalloc-static )
message ( STATUS "Using mimalloc: ${MIMALLOC_INCLUDE_DIR} : ${MIMALLOC_LIBRARY}" )
endif ( )