Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #103: cmake: Do not interfere with Qt plugin handling
f3b3928 fixup! cmake: Build `bitcoin-qt` executable (Hennadii Stepanov) 3c27391 qt: Drop `Q_IMPORT_PLUGIN` macros (Hennadii Stepanov) edc8c18 qt, build: Drop `QT_STATICPLUGIN` macro (Hennadii Stepanov) Pull request description: 1. 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 and [duplicates](#103 (comment)) the included plugins. For example, on the staging branch @ 1a976ca: ``` 2024-03-01T10:51:26Z Bitcoin Core version v26.99.0-1a976ca427ca (release build) 2024-03-01T10:51:26Z Qt 5.15.11 (static), plugin=windows (static) 2024-03-01T10:51:26Z Static plugins: 2024-03-01T10:51:26Z QWindowsIntegrationPlugin, version 331520 2024-03-01T10:51:26Z QWindowsVistaStylePlugin, version 331520 2024-03-01T10:51:26Z QWindowsVistaStylePlugin, version 331520 2024-03-01T10:51:26Z QWindowsIntegrationPlugin, version 331520 2024-03-01T10:51:26Z Style: windowsvista / QWindowsVistaStyle 2024-03-01T10:51:26Z System: Windows 11 Version 2009, x86_64-little_endian-llp64 2024-03-01T10:51:26Z Screen: \\.\DISPLAY1 1920x1080, pixel ratio=1.0 ``` Initially noticed in #101 (review). Here are `LogQtInfo()` outputs in the `debug.log`: - `x86_64-pc-linux-gnu`: ``` 2024-02-25T10:15:18Z Qt 5.15.11 (static), plugin=xcb (static) 2024-02-25T10:15:18Z Static plugins: 2024-02-25T10:15:18Z QXcbIntegrationPlugin, version 331520 2024-02-25T10:15:18Z Style: fusion / QFusionStyle 2024-02-25T10:15:18Z System: Ubuntu 22.04.4 LTS, x86_64-little_endian-lp64 2024-02-25T10:15:18Z Screen: XWAYLAND0 1920x1080, pixel ratio=1.0 ``` - `x86_64-w64-mingw32` ``` 2024-02-25T10:44:54Z Qt 5.15.11 (static), plugin=windows (static) 2024-02-25T10:44:54Z Static plugins: 2024-02-25T10:44:54Z QWindowsVistaStylePlugin, version 331520 2024-02-25T10:44:54Z QWindowsIntegrationPlugin, version 331520 2024-02-25T10:44:54Z Style: windowsvista / QWindowsVistaStyle 2024-02-25T10:44:54Z System: Windows 11 Version 2009, x86_64-little_endian-llp64 2024-02-25T10:44:54Z Screen: \\.\DISPLAY1 1600x900, pixel ratio=1.0 ``` --- 2. Apparently, Qt tries to link its default set of static plugins to every suitable target. When building on Windows, it leads to an insane list of plugins: ``` 2024-03-01T19:11:04Z Qt 5.15.10 (static), plugin=windows (dynamic) 2024-03-01T19:11:04Z Static plugins: 2024-03-01T19:11:04Z QGifPlugin, version 331520 2024-03-01T19:11:04Z QICNSPlugin, version 331520 2024-03-01T19:11:04Z QICOPlugin, version 331520 2024-03-01T19:11:04Z QJpegPlugin, version 331520 2024-03-01T19:11:04Z QSvgIconPlugin, version 331520 2024-03-01T19:11:04Z QSvgPlugin, version 331520 2024-03-01T19:11:04Z QTgaPlugin, version 331520 2024-03-01T19:11:04Z QTiffPlugin, version 331520 2024-03-01T19:11:04Z QWbmpPlugin, version 331520 2024-03-01T19:11:04Z QWebpPlugin, version 331520 2024-03-01T19:11:04Z QWindowsIntegrationPlugin, version 331520 2024-03-01T19:11:04Z QWindowsVistaStylePlugin, version 331520 ``` Therefore, in this PR, we prevent Qt from such a behaviour. ACKs for top commit: m3dwards: ACK f3b3928 Tree-SHA512: e77aad13349b6938d1c4c48c12a2e32226ef9b2c9e52e021df94a9a21b6bd0e42685f73f032eb5bfded9438f16edf2badac775200e941e18d73da85b0b817d3c
- Loading branch information