By #include ing not only the *.moc, but also the moc_*.cpp files, we can speed up compilation of Qt (albeit not for users of Qt), reduce the TEXT size of libraries, and enable more warnings (like Clang's -Wunused-private-field). By the time we tackle this, there should be a new includemocs6 script (from
QTBUG-102886) in QtBase, that no longer requires a qmake build to operate.
- Acceptance criteria: mocs_compilation.cpp files should not #include anything.
- Backport to all branches (6.3, 6.2, 5.15).
- Script incl wrapper: https://codereview.qt-project.org/c/qt/qtbase/+/409553
- inspiration in case stuff goes wrong:
- no QT_END_NAMESPACE found: https://codereview.qt-project.org/c/qt/qtdeclarative/+/409613
- no .cpp found to include the moc-file:
- simple: https://codereview.qt-project.org/c/qt/qtconnectivity/+/409378
- a bit more complicated: https://codereview.qt-project.org/c/qt/qtdeclarative/+/409612
If you have questions, ask Marc Mutz.