Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Commit 57a78bd

Browse files
committed
cmake: Do not build with rocksdb by default
1 parent 09ee501 commit 57a78bd

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- Changed: [#5602](https://github.com/ethereum/aleth/pull/5602) Better predicting external IP address and UDP port.
2222
- Changed: [#5605](https://github.com/ethereum/aleth/pull/5605) Network logging bugfixes and improvements and add warpcap log channel.
2323
- Changed: [#5628](https://github.com/ethereum/aleth/pull/5628) Don't try to endlessly reconnect to official Ethereum bootnodes.
24+
- Changed: [#5632](https://github.com/ethereum/aleth/pull/5632) RocksDB support is disabled by default. Enable with `-DROCKSB=ON` CMake option.
2425
- Fixed: [#5562](https://github.com/ethereum/aleth/pull/5562) Don't send header request messages to peers that haven't sent us Status yet.
2526
- Fixed: [#5581](https://github.com/ethereum/aleth/pull/5581) Fixed finding neighbour nodes in Discovery.
2627
- Fixed: [#5599](https://github.com/ethereum/aleth/pull/5600) Prevent aleth from attempting concurrent connection to node which results in disconnect of original connection.

cmake/EthOptions.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ macro(configure_project)
1313
option(PARANOID "Enable additional checks when validating transactions (deprecated)" OFF)
1414
option(MINIUPNPC "Build with UPnP support" OFF)
1515
option(FASTCTEST "Enable fast ctest" OFF)
16+
option(ROCKSDB "Build with rocksdb as optional database implementation" OFF)
1617

1718
if(MINIUPNPC)
1819
message(WARNING
@@ -71,7 +72,7 @@ macro(print_config)
7172
message("--------------------------------------------------------------- features")
7273
message("-- EVM_OPTIMIZE Enable VM optimizations ${EVM_OPTIMIZE}")
7374
message("-- FATDB Full database exploring ${FATDB}")
74-
message("-- DB Database implementation LEVELDB")
75+
message("-- ROCKSDB RocksDB as optional DB implementation ${ROCKSDB}")
7576
message("-- PARANOID - ${PARANOID}")
7677
message("-- MINIUPNPC - ${MINIUPNPC}")
7778
message("------------------------------------------------------------- components")

libdevcore/CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ add_library(
3939
OverlayDB.h
4040
RLP.cpp
4141
RLP.h
42-
RocksDB.cpp
43-
RocksDB.h
4442
SHA3.cpp
4543
SHA3.h
4644
StateCacheDB.cpp
@@ -68,6 +66,10 @@ hunter_add_package(leveldb)
6866
find_package(leveldb CONFIG REQUIRED)
6967
target_link_libraries(devcore PRIVATE leveldb::leveldb)
7068

71-
hunter_add_package(rocksdb)
72-
find_package(RocksDB CONFIG REQUIRED)
73-
target_link_libraries(devcore PRIVATE RocksDB::rocksdb)
69+
if(ROCKSDB)
70+
hunter_add_package(rocksdb)
71+
find_package(RocksDB CONFIG REQUIRED)
72+
target_sources(devcore PRIVATE RocksDB.cpp RocksDB.h)
73+
target_link_libraries(devcore PRIVATE RocksDB::rocksdb)
74+
target_compile_definitions(devcore PRIVATE ALETH_ROCKSDB)
75+
endif()

libdevcore/DBFactory.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
#include "DBFactory.h"
1919
#include "FileSystem.h"
2020
#include "LevelDB.h"
21-
#include "RocksDB.h"
2221
#include "MemoryDB.h"
2322
#include "libethcore/Exceptions.h"
2423

24+
#if ALETH_ROCKSDB
25+
#include "RocksDB.h"
26+
#endif
27+
2528
namespace dev
2629
{
2730
namespace db
@@ -48,7 +51,9 @@ struct DBKindTableEntry
4851
/// so linear search only to parse command line arguments is not a problem.
4952
DBKindTableEntry dbKindsTable[] = {
5053
{DatabaseKind::LevelDB, "leveldb"},
54+
#if ALETH_ROCKSDB
5155
{DatabaseKind::RocksDB, "rocksdb"},
56+
#endif
5257
{DatabaseKind::MemoryDB, "memorydb"},
5358
};
5459

@@ -154,9 +159,11 @@ std::unique_ptr<DatabaseFace> DBFactory::create(DatabaseKind _kind, fs::path con
154159
case DatabaseKind::LevelDB:
155160
return std::unique_ptr<DatabaseFace>(new LevelDB(_path));
156161
break;
162+
#if ALETH_ROCKSDB
157163
case DatabaseKind::RocksDB:
158164
return std::unique_ptr<DatabaseFace>(new RocksDB(_path));
159165
break;
166+
#endif
160167
case DatabaseKind::MemoryDB:
161168
// Silently ignore path since the concept of a db path doesn't make sense
162169
// when using an in-memory database

0 commit comments

Comments
 (0)