<div dir="ltr"><div>[Resending to the entire list this time]</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 28, 2020 at 3:12 PM Thiago Macieira <<a href="mailto:thiago.macieira@intel.com">thiago.macieira@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thursday, 28 May 2020 10:19:58 PDT Adam Light wrote:<br>
> I'm including generating moc files in "build time". I'm not saying that<br>
> compiling the .cpp files will take significantly longer, but if a .cpp file<br>
> has a #include "myclass.moc" type statement, that .cpp file has to be<br>
> processed by moc<br>
<br>
You're talking about when myclass.cpp has a Q_OBJECT. That's the only reason <br>
when moc needs to parse that .cpp.<br>
<br>
But you also don't have a choice. You have to #include the .moc output.<br></blockquote><div><br></div><div>Yes, that's right. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
We're talking about #include "moc_myclass.cpp", which is when "myclass.h" has <br>
a Q_OBJECT. You don't have to have that #include. But if you do, then it's one <br>
fewer .cpp file that needs to be compiled. It generates better code and <br>
enables more warnings.<br>
<br>
The only drawback is that the compilation needs to wait for moc to finish. If <br>
you have a cluster, it means the cluster can't be used until moc has finished, <br>
for that file. But that's only for the first file.<br></blockquote><div><br></div><div>Right. I got confused about the earlier mention of ".moc", even though it clearly would not make sense for every class that uses Q_OBJECT to be declared in a .cpp file.</div><div><br></div><div>I will note, however, that  #including the moc output from the .cpp file (the "moc_myclass.cpp" form) is not compatible with my mocinclude trick posted at <a href="https://bugreports.qt.io/browse/QTBUG-81348" target="_blank">https://bugreports.qt.io/browse/QTBUG-81348</a>.</div><div><br></div><div>And we are not using a cluster or anything particularly fancy, just a regular (self-built) desktop machine with a 16 core/32 thread AMD Threadripper processor and otherwise high end consumer components.</div><div><br></div><div>Adam </div><div> </div></div></div>