From 498b6eb6b5e8aceb372d3097df2715d9c7fc416b Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Wed, 18 Mar 2026 10:43:28 +0100 Subject: [PATCH] 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. --- CMakeLists.txt | 4 ++++ src/wallet/CMakeLists.txt | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 518e02776d4..26e5fede0eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt index 8ec381df5a8..36fd3ef95ae 100644 --- a/src/wallet/CMakeLists.txt +++ b/src/wallet/CMakeLists.txt @@ -38,8 +38,7 @@ target_link_libraries(bitcoin_wallet PRIVATE core_interface bitcoin_common - $ - $ + SQLite3::SQLite3 univalue Boost::headers $