Merge bitcoin/bitcoin#34848: cmake: Migrate away from deprecated SQLite3 target

498b6eb6b5 cmake: Migrate away from deprecated SQLite3 target (Daniel Pfeifer)

Pull request description:

  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.

ACKs for top commit:
  hebasto:
    ACK 498b6eb6b5, tested on Fedora 43 using CMake 3.22.6 and 4.3.0.

Tree-SHA512: 8ec0e9673ea39c4383d2995d804498675f9bcd1196ec586f338cb3fa63aa632f160dd179bda3c2d70d932d8b1ac821c15d8247e7302465420937c9227f1bf20a
This commit is contained in:
merge-script
2026-03-19 14:32:31 +08:00
2 changed files with 5 additions and 2 deletions

View File

@@ -117,8 +117,12 @@ if(ENABLE_WALLET)
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()
endif()
cmake_dependent_option(BUILD_WALLET_TOOL "Build bitcoin-wallet tool." ${BUILD_TESTS} "ENABLE_WALLET" OFF)

View File

@@ -38,8 +38,7 @@ target_link_libraries(bitcoin_wallet
PRIVATE
core_interface
bitcoin_common
$<TARGET_NAME_IF_EXISTS:unofficial::sqlite3::sqlite3>
$<TARGET_NAME_IF_EXISTS:SQLite::SQLite3>
SQLite3::SQLite3
univalue
Boost::headers
$<TARGET_NAME_IF_EXISTS:USDT::headers>