On Wed, May 27, 2020 at 8:51 AM Thiago Macieira <thiago.macie...@intel.com> wrote:
> On Wednesday, 27 May 2020 03:42:19 PDT Oswald Buddenhagen wrote: > > > this is not something we can subject our users to. > > > > orly? kde had been doing that for quite a while. > > And I fixed QtCore to do the same. > > The only reason not to include the moc output in your .cpp is if you don't > have one (a header-only class whose only non-inline methods are the moc- > generated ones). Otherwise, #include your mocs. > > That said, we shouldn't enforce this. > > On Windows, the way moc satisfies #includes is very slow, particularly when many (32 in my case) moc processes are running concurrently. Since .cpp files tend to result in many more included files, #including a .moc file from a .cpp file as a regular practice could significantly increase build times, and it also prevents an optimization I came up with that mitigates the poor moc performance (see https://bugreports.qt.io/browse/QTBUG-81348 for details). As core count increases, moc's performance might impact more users, though it may not be obvious to many of them. Changing Qt in a way that would require #including the moc output from the .cpp file might cause noticeable increase in build times unless moc is also changed. Adam
_______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development