From 4b116c214c5fdce3728ec9a161d30bc466da2b8b Mon Sep 17 00:00:00 2001 From: Denis Glazachev Date: Thu, 8 Apr 2021 13:16:02 +0400 Subject: [PATCH] Disable jemalloc for ALL macOS non-RelWithDebInfo builds Revisit default ENABLE_* flag setting --- cmake/find/rocksdb.cmake | 7 +++---- contrib/jemalloc-cmake/CMakeLists.txt | 11 +++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cmake/find/rocksdb.cmake b/cmake/find/rocksdb.cmake index f476e90033f..94278a603d7 100644 --- a/cmake/find/rocksdb.cmake +++ b/cmake/find/rocksdb.cmake @@ -1,10 +1,9 @@ -option(ENABLE_ROCKSDB "Enable ROCKSDB" ${ENABLE_LIBRARIES}) - if (OS_DARWIN AND ARCH_AARCH64) - set (USE_INTERNAL_ROCKSDB_LIBRARY OFF) - set (ENABLE_ROCKSDB OFF) + set (ENABLE_ROCKSDB OFF CACHE INTERNAL "") endif() +option(ENABLE_ROCKSDB "Enable ROCKSDB" ${ENABLE_LIBRARIES}) + if (NOT ENABLE_ROCKSDB) if (USE_INTERNAL_ROCKSDB_LIBRARY) message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal rocksdb library with ENABLE_ROCKSDB=OFF") diff --git a/contrib/jemalloc-cmake/CMakeLists.txt b/contrib/jemalloc-cmake/CMakeLists.txt index 43ac0ad568f..ce6ed410e79 100644 --- a/contrib/jemalloc-cmake/CMakeLists.txt +++ b/contrib/jemalloc-cmake/CMakeLists.txt @@ -1,10 +1,13 @@ -if (SANITIZE OR NOT (ARCH_AMD64 OR ARCH_ARM OR ARCH_PPC64LE) OR NOT (OS_LINUX OR OS_FREEBSD OR OS_DARWIN) OR (OS_DARWIN AND ARCH_AARCH64)) +if (SANITIZE OR NOT ( + (OS_LINUX OR OS_FREEBSD) AND (ARCH_AMD64 OR ARCH_ARM OR ARCH_PPC64LE)) OR + (OS_DARWIN AND ARCH_AMD64 AND CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") +)) if (ENABLE_JEMALLOC) message (${RECONFIGURE_MESSAGE_LEVEL} - "jemalloc is disabled implicitly: it doesn't work with sanitizers and can only be used with x86_64, aarch64 or ppc64le on linux or freebsd.") - endif() + "jemalloc is disabled implicitly: it doesn't work with sanitizers and can only be used with x86_64, aarch64, or ppc64le Linux or FreeBSD builds and x86_64 RelWithDebInfo macOS builds.") + endif () set (ENABLE_JEMALLOC OFF) -else() +else () option (ENABLE_JEMALLOC "Enable jemalloc allocator" ${ENABLE_LIBRARIES}) endif ()