@@ -57,7 +57,10 @@ set(CMAKE_CXX_EXTENSIONS OFF)
57
57
58
58
list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} /cmake/module )
59
59
60
- # Configurable options.
60
+ #=============================
61
+ # Configurable options
62
+ #=============================
63
+ include (CMakeDependentOption )
61
64
# When adding a new option, end the <help_text> with a full stop for consistency.
62
65
option (BUILD_DAEMON "Build bitcoind executable." ON )
63
66
option (BUILD_CLI "Build bitcoin-cli executable." ON )
@@ -67,20 +70,44 @@ option(BUILD_UTIL_CHAINSTATE "Build experimental bitcoin-chainstate executable."
67
70
option (BUILD_KERNEL_LIB "Build experimental bitcoinkernel library." ${BUILD_UTIL_CHAINSTATE} )
68
71
69
72
option (ENABLE_WALLET "Enable wallet." ON )
70
- # TODO: These tri-state options will be removed and most features
71
- # will become opt-in by default before merging into master.
72
- include (TristateOption )
73
- tristate_option (WITH_SQLITE "Enable SQLite wallet support." "if libsqlite3 is found." AUTO )
74
- tristate_option (WITH_BDB "Enable Berkeley DB (BDB) wallet support." "if libdb_cxx is found." AUTO )
75
- option (WARN_INCOMPATIBLE_BDB "Warn when using a Berkeley DB (BDB) version other than 4.8." ON )
76
- include (CMakeDependentOption )
73
+ option (WITH_SQLITE "Enable SQLite wallet support." ${ENABLE_WALLET} )
74
+ if (WITH_SQLITE )
75
+ if (VCPKG_TARGET_TRIPLET )
76
+ # Use of the `unofficial::` namespace is a vcpkg package manager convention.
77
+ find_package (unofficial-sqlite3 CONFIG REQUIRED )
78
+ else ()
79
+ find_package (SQLite3 3.7.17 REQUIRED )
80
+ endif ()
81
+ set (USE_SQLITE ON )
82
+ set (ENABLE_WALLET ON )
83
+ endif ()
84
+ option (WITH_BDB "Enable Berkeley DB (BDB) wallet support." OFF )
85
+ cmake_dependent_option (WARN_INCOMPATIBLE_BDB "Warn when using a Berkeley DB (BDB) version other than 4.8." ON "WITH_BDB" OFF )
86
+ if (WITH_BDB )
87
+ find_package (BerkeleyDB 4.8 MODULE REQUIRED )
88
+ set (USE_BDB ON )
89
+ set (ENABLE_WALLET ON )
90
+ if (NOT BerkeleyDB_VERSION VERSION_EQUAL 4.8 )
91
+ message (WARNING "Found Berkeley DB (BDB) other than 4.8.\n "
92
+ "BDB (legacy) wallets opened by this build will not be portable!"
93
+ )
94
+ if (WARN_INCOMPATIBLE_BDB )
95
+ message (WARNING "If this is intended, pass \" -DWARN_INCOMPATIBLE_BDB=OFF\" .\n "
96
+ "Passing \" -DWITH_BDB=OFF\" will suppress this warning."
97
+ )
98
+ endif ()
99
+ endif ()
100
+ endif ()
77
101
cmake_dependent_option (BUILD_WALLET_TOOL "Build bitcoin-wallet tool." ON "ENABLE_WALLET" OFF )
78
102
79
103
option (THREADLOCAL "Enable features that depend on the C++ thread_local keyword (currently just thread names in debug logs)." ON )
80
104
option (HARDENING "Attempt to harden the resulting executables." ON )
81
105
option (REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting executables." OFF )
82
106
option (WERROR "Treat compiler warnings as errors." OFF )
83
107
108
+ # TODO: These tri-state options will be removed and most features
109
+ # will become opt-in by default before merging into master.
110
+ include (TristateOption )
84
111
tristate_option (CCACHE "Use ccache for compiling." "if ccache is found." AUTO )
85
112
86
113
option (WITH_NATPMP "Enable NAT-PMP." OFF )
0 commit comments