From 0fb5e167e8e332e3d40659406b3222a22747aa0e 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. Github-Pull: #34848 Rebased-From: 498b6eb6b5e8aceb372d3097df2715d9c7fc416b --- CMakeLists.txt | 4 ++++ src/wallet/CMakeLists.txt | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e2c8680892..3c31bd08dde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt index 121e6e3c837..ee81c6b17a2 100644 --- a/src/wallet/CMakeLists.txt +++ b/src/wallet/CMakeLists.txt @@ -49,8 +49,7 @@ if(USE_SQLITE) target_sources(bitcoin_wallet PRIVATE sqlite.cpp) target_link_libraries(bitcoin_wallet PRIVATE - $ - $ + SQLite3::SQLite3 ) endif() if(USE_BDB)