aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt47
1 files changed, 19 insertions, 28 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e95f48ff..9674404bb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -206,41 +206,32 @@ elseif()
endif()
if (DATABASE STREQUAL "lmdb")
+ message(STATUS "Using LMDB as default DB type")
set(BLOCKCHAIN_DB DB_LMDB)
-
- # temporarily allow mingw to compile with berkeley_db,
- # regardless if building static or not
- if(NOT STATIC OR MINGW)
- find_package(BerkeleyDB)
-
- if(BERKELEY_DB_OVERRIDE AND NOT BERKELEY_DB)
- message(STATUS "BERKELEY_DB setting has been overridden and disabled")
- elseif(NOT BERKELEY_DB_LIBRARIES)
- message(STATUS "BerkeleyDB not found and has been disabled.")
+ add_definitions("-DDEFAULT_DB_TYPE=\"lmdb\"")
+elseif (DATABASE STREQUAL "berkeleydb")
+ find_package(BerkeleyDB)
+ if(NOT BERKELEY_DB)
+ die("Found BerkeleyDB includes, but could not find BerkeleyDB library. Please make sure you have installed libdb and libdb-dev / libdb++-dev or the equivalent.")
+ else()
+ message(STATUS "Found BerkeleyDB include (db.h) in ${BERKELEY_DB_INCLUDE_DIR}")
+ if(BERKELEY_DB_LIBRARIES)
+ message(STATUS "Found BerkeleyDB shared library")
+ set(BDB_STATIC false CACHE BOOL "BDB Static flag")
+ set(BDB_INCLUDE ${BERKELEY_DB_INCLUDE_DIR} CACHE STRING "BDB include path")
+ set(BDB_LIBRARY ${BERKELEY_DB_LIBRARIES} CACHE STRING "BDB library name")
+ set(BDB_LIBRARY_DIRS "" CACHE STRING "BDB Library dirs")
+ set(BERKELEY_DB 1)
else()
- message(STATUS "Found BerkeleyDB include (db.h) in ${BERKELEY_DB_INCLUDE_DIR}")
- if(BERKELEY_DB_LIBRARIES)
- message(STATUS "Found BerkeleyDB shared library")
- set(BDB_STATIC false CACHE BOOL "BDB Static flag")
- set(BDB_INCLUDE ${BERKELEY_DB_INCLUDE_DIR} CACHE STRING "BDB include path")
- set(BDB_LIBRARY ${BERKELEY_DB_LIBRARIES} CACHE STRING "BDB library name")
- set(BDB_LIBRARY_DIRS "" CACHE STRING "BDB Library dirs")
- set(BERKELEY_DB 1)
- else()
- message(STATUS "Found BerkeleyDB includes, but could not find BerkeleyDB library. Please make sure you have installed libdb and libdb-dev or the equivalent")
- endif()
+ die("Found BerkeleyDB includes, but could not find BerkeleyDB library. Please make sure you have installed libdb and libdb-dev / libdb++-dev or the equivalent.")
endif()
endif()
- if (BERKELEY_DB AND (ARCH_WIDTH STREQUAL "32" OR ARM6 OR ARM7))
- message(STATUS "Using Berkeley DB as default DB type")
- add_definitions("-DDEFAULT_DB_TYPE=\"berkeley\"")
- else()
- message(STATUS "Using LMDB as default DB type")
- add_definitions("-DDEFAULT_DB_TYPE=\"lmdb\"")
- endif()
+ message(STATUS "Using Berkeley DB as default DB type")
+ add_definitions("-DDEFAULT_DB_TYPE=\"berkeley\"")
elseif (DATABASE STREQUAL "memory")
set(BLOCKCHAIN_DB DB_MEMORY)
+ message(STATUS "Using Serialised In Memory as default DB type")
add_definitions("-DDEFAULT_DB_TYPE=\"memory\"")
else()
die("Invalid database type: ${DATABASE}")