ENDIF(NOT LUA_FOUND)
ENDIF(ENABLE_LUAJIT MATCHES "ON")
-IF(ENABLE_JEMALLOC MATCHES "ON")
+IF(ENABLE_JEMALLOC MATCHES "ON" AND NOT SANITIZE)
ProcessPackage(JEMALLOC LIBRARY jemalloc_pic jemalloc INCLUDE jemalloc.h INCLUDE_SUFFIXES include/jemalloc
ROOT ${JEMALLOC_ROOT_DIR})
SET(WITH_JEMALLOC "1")
if (SANITIZE)
if (ENABLE_JEMALLOC MATCHES "ON")
message (STATUS "Jemalloc support is useless in case of build with sanitizers")
+ set (ENABLE_JEMALLOC "OFF")
endif ()
if (SANITIZE STREQUAL "address")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope")