From beb1a624921d7589db63dea066935b3aa9ce2698 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 15 Dec 2023 19:03:57 +0800 Subject: [PATCH] cmake/modules/BuildRocksDB.cmake: inherit parent's CMAKE_CXX_FLAGS CMake allows us to customize `CMAKE_CXX_FLAGS` by setting CXXFLAGS environmental variable. and Debian's debhelper also sets CXXFLAGS when it builds cmake projects for customizing the building flags. but we fail to populate this setting down when building external projects. this is important when it comes to the projects which is critical to the performance. RocksDB is one of them. in this change, we pass the `CMAKE_CXX_FLAGS` down in `BuildRocksDB.cmake` so that its `CMAKE_CXX_FLAGS` contains the same set of `CMAKE_CXX_FLAGS` used by its parent project. this should help with the performance in the bluestore, where RocksDB is used. Signed-off-by: Kefu Chai --- cmake/modules/BuildRocksDB.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/modules/BuildRocksDB.cmake b/cmake/modules/BuildRocksDB.cmake index f81f5248506dd..e0208f6545b70 100644 --- a/cmake/modules/BuildRocksDB.cmake +++ b/cmake/modules/BuildRocksDB.cmake @@ -59,6 +59,7 @@ function(build_rocksdb) endif() include(CheckCXXCompilerFlag) check_cxx_compiler_flag("-Wno-deprecated-copy" HAS_WARNING_DEPRECATED_COPY) + set(rocksdb_CXX_FLAGS "${CMAKE_CXX_FLAGS}") if(HAS_WARNING_DEPRECATED_COPY) string(APPEND rocksdb_CXX_FLAGS " -Wno-deprecated-copy") endif() -- 2.39.5