<table><tr><td style="">kossebau created this revision.<br />kossebau added a reviewer: KDevelop.<br />Restricted Application added a subscriber: kdevelop-devel.<br />kossebau requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D10666" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The JSON file argument passed to K_PLUGIN_FACTORY_WITH_JSON ends up<br />
being used with the macro Q_PLUGIN_METADATA, which is a no-code macro<br />
at the C++ level and only used to note information used by moc for the<br />
generated moc file.</p>

<p>So when the content of the JSON file has changed, this will not change<br />
anything in the preprocessed source file itself. It will only change the<br />
content of the moc file generated based on it, which already is noted<br />
as dependency to the object file due to being a file included by the<br />
source.</p>

<p>This code possibly was added hoping to solve the issue of cmake's automoc<br />
not properly dealing with Q_OBJECT macros hidden away in other C++<br />
preprocessor macros. But it misses to catch the issue that it is the<br />
generated moc file which needs to be regenerated on a change of the JSON<br />
file, not just the object file.<br />
Regenerating the moc file is something only automoc decides about when<br />
being run and which seems not influenced by CMakeLists.txt rules.</p>

<p>Cmp. <a href="https://gitlab.kitware.com/cmake/cmake/issues/17750" class="remarkup-link" target="_blank" rel="noreferrer">https://gitlab.kitware.com/cmake/cmake/issues/17750</a></p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Still builds as before.<br />
Editing JSON files still results in same (broken) effective rebuild<br />
behaviour: the moc file is not regenerated, so the new JSON content<br />
not picked up. Other than before the unneeded-because-all-sources-the-same<br />
rebuild of the object file is skipped though.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>BRANCH</strong><div><div>removeeffectlessOBJECT_DEPENDS</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D10666" rel="noreferrer">https://phabricator.kde.org/D10666</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>kdevplatform/cmake/modules/KDevPlatformMacros.cmake</div></div></div><br /><div><strong>To: </strong>kossebau, KDevelop<br /><strong>Cc: </strong>kdevelop-devel<br /></div>