mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-22 11:55:22 +02:00
cmake: Migrate away from deprecated SQLite3 target
CMake version 4.3 deprecated the imported target `Sqlite::Sqlite3`.
Use the preferred name `Sqlite3::Sqlite3` instead and provide an
alias for older versions of CMake. Also define the same alias when
using vcpkg.
Github-Pull: #34848
Rebased-From: 498b6eb6b5
This commit is contained in:
@@ -111,8 +111,12 @@ if(WITH_SQLITE)
|
||||
if(VCPKG_TARGET_TRIPLET)
|
||||
# Use of the `unofficial::` namespace is a vcpkg package manager convention.
|
||||
find_package(unofficial-sqlite3 CONFIG REQUIRED)
|
||||
add_library(SQLite3::SQLite3 ALIAS unofficial::sqlite3::sqlite3)
|
||||
else()
|
||||
find_package(SQLite3 3.7.17 REQUIRED)
|
||||
if(NOT TARGET SQLite3::SQLite3) # CMake < 4.3
|
||||
add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3)
|
||||
endif()
|
||||
endif()
|
||||
set(USE_SQLITE ON)
|
||||
endif()
|
||||
|
||||
@@ -49,8 +49,7 @@ if(USE_SQLITE)
|
||||
target_sources(bitcoin_wallet PRIVATE sqlite.cpp)
|
||||
target_link_libraries(bitcoin_wallet
|
||||
PRIVATE
|
||||
$<TARGET_NAME_IF_EXISTS:unofficial::sqlite3::sqlite3>
|
||||
$<TARGET_NAME_IF_EXISTS:SQLite::SQLite3>
|
||||
SQLite3::SQLite3
|
||||
)
|
||||
endif()
|
||||
if(USE_BDB)
|
||||
|
||||
Reference in New Issue
Block a user