cmake: Switch from AUTORCC to `qt6_add_resources`
What changed, and why it matters
This commit changes how Bitcoin Core's Qt graphical interface build system handles embedded resource files (like icons and translations). It switches from CMake's automatic Qt resource handling to an explicit Qt6 function call. There is no indication this is a security fix; it appears to be a routine build-system refactor for finer control over compilation.
No security action required. Treat as ordinary build-system maintenance; verify that Qt resource files are still correctly embedded in resulting binaries.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies src/qt/CMakeLists.txt to disable CMAKE_AUTORCC and instead explicitly call qt6_add_resources() for bitcoin.qrc and the configured bitcoin_locale.qrc. The generated resource targets are then added to the bitcoinqt static library. This is a build-system modernization/behavior change, not a vulnerability remediation.
Changed components
src/qt/CMakeLists.txtInspect captured patch +5 / −3
diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt
index c23a7ec6..2f66fb3c 100644
--- a/src/qt/CMakeLists.txt
+++ b/src/qt/CMakeLists.txt
@@ -50,11 +50,13 @@ endfunction()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOMOC_MOC_OPTIONS "-p${CMAKE_CURRENT_SOURCE_DIR}")
-set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOUIC_SEARCH_PATHS forms)
+set(CMAKE_AUTORCC OFF)
configure_file(bitcoin_locale.qrc bitcoin_locale.qrc USE_SOURCE_PERMISSIONS COPYONLY)
+qt6_add_resources(BITCOIN_QRC bitcoin.qrc)
+qt6_add_resources(BITCOIN_LOCALE_QRC ${CMAKE_CURRENT_BINARY_DIR}/bitcoin_locale.qrc)
# The bitcoinqt sources have to include headers in
# order to parse them to collect translatable strings.
@@ -119,8 +121,8 @@ add_library(bitcoinqt STATIC EXCLUDE_FROM_ALL
utilitydialog.h
$<$<PLATFORM_ID:Windows>:winshutdownmonitor.cpp>
$<$<PLATFORM_ID:Windows>:winshutdownmonitor.h>
- bitcoin.qrc
- ${CMAKE_CURRENT_BINARY_DIR}/bitcoin_locale.qrc
+ ${BITCOIN_QRC}
+ ${BITCOIN_LOCALE_QRC}
)
target_compile_definitions(bitcoinqt
PUBLIC
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.