From 5a2e82948968022c02d8494160680e0f344d346a Mon Sep 17 00:00:00 2001 From: Ivan Lezhankin Date: Tue, 17 Mar 2020 14:22:15 +0300 Subject: [PATCH] Some fixes --- contrib/jemalloc-cmake/CMakeLists.txt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/contrib/jemalloc-cmake/CMakeLists.txt b/contrib/jemalloc-cmake/CMakeLists.txt index 65b5d5fdcfa..3f685bfefd4 100644 --- a/contrib/jemalloc-cmake/CMakeLists.txt +++ b/contrib/jemalloc-cmake/CMakeLists.txt @@ -1,18 +1,14 @@ option (ENABLE_JEMALLOC "Enable jemalloc allocator" ${ENABLE_LIBRARIES}) -if (SANITIZE) - set (ENABLE_JEMALLOC FALSE) - message (STATUS "jemalloc is disabled because of sanitizers") +if (SANITIZE OR NOT OS_LINUX OR NOT (ARCH_AMD64 OR ARCH_ARM)) + set (ENABLE_JEMALLOC OFF) + message (STATUS "jemalloc is disabled implicitly: it doesn't work with sanitizers and can only be used on Linux with x86_64 or aarch64.") endif () if (ENABLE_JEMALLOC) option (USE_INTERNAL_JEMALLOC "Use internal jemalloc library" ${NOT_UNBUNDLED}) if (USE_INTERNAL_JEMALLOC) - if (NOT OS_LINUX OR NOT (ARCH_AMD64 OR ARCH_ARM)) - message (FATAL_ERROR "Internal jemalloc can only be used on Linux with x86_64 or aarch64.") - endif () - set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/jemalloc") set (SRCS @@ -72,6 +68,8 @@ if (ENABLE_JEMALLOC) target_link_libraries (jemalloc PRIVATE unwind) endif () endif () + + target_compile_options(jemalloc PUBLIC -Wno-redundant-decls) else () find_library(LIBRARY_JEMALLOC jemalloc) find_path(INCLUDE_JEMALLOC jemalloc/jemalloc.h)