cmake: disable rocksdb from using jemalloc unless asked

rocksdb detects used libraries by itself. it we don't disable it
explicitly, it will pull in unresolved symbols at ceph's link
time. so we disable it unless jemalloc is enabled at configure-time.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2016-06-08 11:44:04 +08:00
parent 48a1f8eff5
commit 8922206164

View File

@ -834,9 +834,12 @@ if(WITH_SPDK)
endif(WITH_SPDK)
# make rocksdb statically
if(NOT ALLOCATOR STREQUAL "jemalloc")
set(disable_jemalloc "DISABLE_JEMALLOC=1")
endif()
add_custom_target(build_rocksdb
COMMAND
PORTABLE=1 $(MAKE) static_lib EXTRA_CXXFLAGS='-fPIC -Wno-unused-variable'
PORTABLE=1 ${disable_jemalloc} $(MAKE) static_lib EXTRA_CXXFLAGS='-fPIC -Wno-unused-variable'
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/rocksdb
COMMENT "rocksdb building")