From 2bcfd7fde19bf43eeae6518ca1e6f92cf6609485 Mon Sep 17 00:00:00 2001 From: Ole Reifschneider Date: Mon, 26 Oct 2015 19:33:50 +0100 Subject: [PATCH] Make jemalloc optional --- CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 348e138a06..53e387307c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,12 +260,16 @@ if((CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) AND NOT CMAKE_C_COMPILER_ID MA message(FATAL_ERROR "Sanitizers are only supported for Clang.") endif() -if(CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) - message(STATUS "Sanitizers have been enabled; don't use jemalloc.") -else() - find_package(JeMalloc) - if(JEMALLOC_FOUND) - include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIRS}) +option(ENABLE_JEMALLOC "enable jemalloc" OFF) + +if (ENABLE_JEMALLOC) + if(CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) + message(STATUS "Sanitizers have been enabled; don't use jemalloc.") + else() + find_package(JeMalloc) + if(JEMALLOC_FOUND) + include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIRS}) + endif() endif() endif()