]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/CMakeLists.txt: pass compiler and flags used to compile into RocksDB build 10418/head
authorWillem Jan Withagen <wjw@digiware.nl>
Sun, 24 Jul 2016 13:48:50 +0000 (15:48 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Wed, 27 Jul 2016 08:34:50 +0000 (10:34 +0200)
 - 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 <wjw@digiware.nl>
src/CMakeLists.txt

index a09ed17f5afa4c9aa842be8e366ed83cfb51ac05..eab2ca17238be01669fa9b22f5962ea7b3c2a85d 100644 (file)
@@ -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")