From: Willem Jan Withagen Date: Sun, 24 Jul 2016 13:48:50 +0000 (+0200) Subject: src/CMakeLists.txt: pass compiler and flags used to compile into RocksDB build X-Git-Tag: ses5-milestone5~280^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10418%2Fhead;p=ceph.git src/CMakeLists.txt: pass compiler and flags used to compile into RocksDB build - make sure the right compiler is used in CXX - NDEBUG if the current code is not being build with debugging Signed-off-by: Willem Jan Withagen --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a09ed17f5afa..eab2ca17238b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -637,9 +637,15 @@ install(TARGETS ceph-mon DESTINATION bin) if(NOT ALLOCATOR STREQUAL "jemalloc") set(disable_jemalloc "DISABLE_JEMALLOC=1") endif() + +set(ROCKSDB_EXTRA_CXXFLAG -fPIC -Wno-unused-variable) +if(NOT CMAKE_BUILD_TYPE STREQUAL Debug) + set(ROCKSDB_EXTRA_CXXFLAG ${ROCKSDB_EXTRA_CXXFLAG} -DNDEBUG) +endif(NOT CMAKE_BUILD_TYPE STREQUAL Debug) + add_custom_target(build_rocksdb COMMAND - PORTABLE=1 ${disable_jemalloc} $(MAKE) static_lib EXTRA_CXXFLAGS='-fPIC -Wno-unused-variable' + PORTABLE=1 ${disable_jemalloc} $(MAKE) static_lib CXX="${CMAKE_CXX_COMPILER}" EXTRA_CXXFLAGS="${ROCKSDB_EXTRA_CXXFLAG}" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/rocksdb COMMENT "rocksdb building")