File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -111,9 +111,16 @@ endif()
111
111
112
112
if (ENABLE_WALLET )
113
113
if (WITH_SQLITE )
114
- include (CrossPkgConfig )
115
- cross_pkg_check_modules (sqlite sqlite3>=3.7.17 IMPORTED_TARGET )
116
- if (sqlite_FOUND )
114
+ # TODO: Consider using the FindSQLite3 module after bumping
115
+ # the minimum required CMake version up to 3.14+.
116
+ if (MSVC )
117
+ # Use of the `unofficial::` namespace is a vcpkg package manager convention.
118
+ find_package (unofficial-sqlite3 CONFIG )
119
+ else ()
120
+ include (CrossPkgConfig )
121
+ cross_pkg_check_modules (sqlite3 sqlite3>=3.7.17 IMPORTED_TARGET )
122
+ endif ()
123
+ if (TARGET unofficial::sqlite3::sqlite3 OR TARGET PkgConfig::sqlite3 )
117
124
set (WITH_SQLITE ON )
118
125
set (USE_SQLITE ON )
119
126
elseif (WITH_SQLITE STREQUAL "AUTO" )
Original file line number Diff line number Diff line change @@ -44,7 +44,11 @@ if(NOT USE_SQLITE AND NOT USE_BDB)
44
44
endif ()
45
45
if (USE_SQLITE )
46
46
target_sources (bitcoin_wallet PRIVATE sqlite.cpp )
47
- target_link_libraries (bitcoin_wallet PRIVATE PkgConfig::sqlite )
47
+ target_link_libraries (bitcoin_wallet
48
+ PRIVATE
49
+ $< TARGET_NAME_IF_EXISTS:unofficial::sqlite3::sqlite3>
50
+ $< TARGET_NAME_IF_EXISTS:PkgConfig::sqlite3>
51
+ )
48
52
endif ()
49
53
if (USE_BDB )
50
54
target_sources (bitcoin_wallet PRIVATE bdb.cpp salvage.cpp )
You can’t perform that action at this time.
0 commit comments