cmake: Do not interfere with Qt plugin handling#103
Conversation
a7653ab to
456eb98
Compare
|
Rebased. Added the "qt, build: Drop |
There was a problem hiding this comment.
tACK 456eb98
git clone --depth=1 --branch 240117-cmake-S https://github.com/hebasto/bitcoin.git
cd bitcoin
cmake -B build
cmake --build build -j $(nproc)
./build/src/qt/bitcoin-qt
debug.log:
2024-02-29T02:58:23Z Bitcoin Core version v26.99.0-7f4babc752c6 (release build)
2024-02-29T02:58:23Z Qt 5.15.3 (dynamic), plugin=xcb (dynamic)
2024-02-29T02:58:23Z No static plugins.
2024-02-29T02:58:23Z Style: fusion / QFusionStyle
2024-02-29T02:58:23Z System: Ubuntu 22.04.3 LTS, x86_64-little_endian-lp64
2024-02-29T02:58:23Z Screen: XWAYLAND0 1920x1200, pixel ratio=1.0
|
with building |
|
In the previous comment the debug.log file was from a build performed on diff So this PR fixes the issue: |
Thank you! I've updated the PR description with the notice about this issue. |
Our `QT_STATICPLUGIN` macro is effectively equivalent to the Qt's `QT_STATIC` macro. No need to handle both of them.
When using CMake, each plugin comes with a C++ stub file that automatically initializes the static plugin. Consequently, any target that links against a plugin has this C++ file added to its SOURCES, which makes the removed code redundant.
Do not interfere with CMake plugin handling.
|
By default, Qt automatically links against a "sane" set of default static plugins. In discussion in-person, @fanquake points out that such a behaviour could be undesirable. That is the case when building on Windows (see the updated PR description). So, this PR has been reworked to prevent any default plugin being linked implicitly. |
|
I'm going to sync the staging branch shortly to accommodate the recent changes in the master branch. It would be nice to have this PR in it before syncing. cc @TheCharlatan @m3dwards @pablomartin4btc @vasild @sipsorcery |
|
ACK f3b3928 Tested on Windows. I can see only three distinct plugin logging entries and no duplication 2024-03-08T11:11:52Z Bitcoin Core version v26.99.0-f3b392845aa2 (release build)
2024-03-08T11:11:52Z Qt 5.15.10 (static), plugin=windows
2024-03-08T11:11:52Z Static plugins:
2024-03-08T11:11:52Z QMinimalIntegrationPlugin, version 331520
2024-03-08T11:11:52Z QWindowsIntegrationPlugin, version 331520
2024-03-08T11:11:52Z QWindowsVistaStylePlugin, version 331520
2024-03-08T11:11:52Z Style: windowsvista / QWindowsVistaStyle
2024-03-08T11:11:52Z System: Windows 11 Version 2009, x86_64-little_endian-llp64
2024-03-08T11:11:52Z Screen: \\.\DISPLAY1 1920x1200, pixel ratio=1.0
2024-03-08T11:11:53Z Script verification uses 15 additional threads
2024-03-08T11:11:53Z Using the 'standard' SHA256 implementation |
SOURCES, which makes the removed code redundant and duplicates the included plugins. For example, on the staging branch @ 1a976ca:Initially noticed in #101 (review).
Here are
LogQtInfo()outputs in thedebug.log:x86_64-pc-linux-gnu:x86_64-w64-mingw32Therefore, in this PR, we prevent Qt from such a behaviour.