]>
Commit | Line | Data |
---|---|---|
65900e1c AD |
1 | From 620b68a348f07145c49c12668576a89dee8198cb Mon Sep 17 00:00:00 2001 |
2 | From: Kefu Chai <tchaikov@gmail.com> | |
3 | Date: Fri, 15 Dec 2023 19:01:46 +0800 | |
4 | Subject: [PATCH] cmake/modules/BuildRocksDB.cmake: inherit parent's CMAKE_CXX_FLAGS | |
5 | ||
6 | CMake allows us to customize `CMAKE_CXX_FLAGS` by setting CXXFLAGS | |
7 | environmental variable. and Debian's debhelper also sets CXXFLAGS | |
8 | when it builds cmake projects for customizing the building flags. | |
9 | ||
10 | but we fail to populate this setting down when building external | |
11 | projects. this is important when it comes to the projects which | |
12 | is critical to the performance. RocksDB is one of them. | |
13 | ||
14 | in this change, we pass the `CMAKE_CXX_FLAGS` down in | |
15 | `BuildRocksDB.cmake` so that its `CMAKE_CXX_FLAGS` contains | |
16 | the same set of `CMAKE_CXX_FLAGS` used by its parent project. | |
17 | ||
18 | this should help with the performance in the bluestore, where | |
19 | RocksDB is used. | |
20 | ||
21 | Signed-off-by: Kefu Chai <tchaikov@gmail.com> | |
22 | [TL: squashed in "cmake/modules/BuildRocksDB.cmake: use string(APPEND | |
23 | ..) when appropriate" ] | |
24 | Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> | |
25 | --- | |
26 | cmake/modules/BuildRocksDB.cmake | 4 ++-- | |
27 | cmake/modules/BuildRocksDB.cmake | 1 + | |
28 | 2 files changed, 3 insertions(+), 2 deletions(-) | |
29 | ||
30 | diff --git a/cmake/modules/BuildRocksDB.cmake b/cmake/modules/BuildRocksDB.cmake | |
31 | index f9a28274c40..e0208f6545b 100644 | |
32 | --- a/cmake/modules/BuildRocksDB.cmake | |
33 | +++ b/cmake/modules/BuildRocksDB.cmake | |
34 | @@ -52,12 +52,13 @@ function(build_rocksdb) | |
35 | endif() | |
36 | include(CheckCXXCompilerFlag) | |
37 | check_cxx_compiler_flag("-Wno-deprecated-copy" HAS_WARNING_DEPRECATED_COPY) | |
38 | + set(rocksdb_CXX_FLAGS "${CMAKE_CXX_FLAGS}") | |
39 | if(HAS_WARNING_DEPRECATED_COPY) | |
40 | - set(rocksdb_CXX_FLAGS -Wno-deprecated-copy) | |
41 | + string(APPEND rocksdb_CXX_FLAGS " -Wno-deprecated-copy") | |
42 | endif() | |
43 | check_cxx_compiler_flag("-Wno-pessimizing-move" HAS_WARNING_PESSIMIZING_MOVE) | |
44 | if(HAS_WARNING_PESSIMIZING_MOVE) | |
45 | - set(rocksdb_CXX_FLAGS "${rocksdb_CXX_FLAGS} -Wno-pessimizing-move") | |
46 | + string(APPEND rocksdb_CXX_FLAGS " -Wno-pessimizing-move") | |
47 | endif() | |
48 | if(rocksdb_CXX_FLAGS) | |
49 | list(APPEND rocksdb_CMAKE_ARGS -DCMAKE_CXX_FLAGS='${rocksdb_CXX_FLAGS}') |