mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
According to the CMake documentation for `AUTOMOC`, all `moc` output files that are not included in a source file are aggregated into the CMake-generated `<AUTOGEN_BUILD_DIR>/mocs_compilation.cpp`, which is added to the target's sources. Within that single translation unit, `moc`-generated code checks the completeness of a signal or slot parameter type while it is still only forward-declared, and the type is completed later, when a subsequently included `moc_*.cpp` file pulls in the header that defines it. GCC 16.x diagnoses this pattern with the `-Wsfinae-incomplete` warning, which is enabled by default. Including the `moc` output files at the end of the corresponding source files excludes them from `mocs_compilation.cpp`, so each one is compiled in a translation unit where the relevant types are complete. Additionally: 1. Some of the `BitcoinGUI` class's private members are gated with `#ifdef ENABLE_WALLET` to prevent `-Wunused-private-field` warnings when building with `-DENABLE_WALLET=OFF`. 2. `test/lint/lint-includes.py` is adjusted to allow new `#include` statements.
6.3 KiB
Executable File
6.3 KiB
Executable File