kossebau created this revision. kossebau added reviewers: Frameworks, apol. Restricted Application added a project: Frameworks. kossebau requested review of this revision.
REVISION SUMMARY The JSON file argument passed to K_PLUGIN_FACTORY_WITH_JSON ends up being used with the macro Q_PLUGIN_METADATA, which is a no-code macro at the C++ level and only used to note information used by moc for the generated moc file. So when the content of the JSON file has changed, this will not change anything in the preprocessed source file itself. It will only change the content of the moc file generated based on it, which already is noted as dependency to the object file due to being a file included by the source. This code possibly was added hoping to solve the issue of cmake's automoc not properly dealing with Q_OBJECT macros hidden away in other C++ preprocessor macros. But it misses to catch the issue that it is the generated moc file which needs to be regenerated on a change of the JSON file, not just the object file. Regenerating the moc file is something only automoc decides about when being run and which seems not influenced by CMakeLists.txt rules. Cmp. https://gitlab.kitware.com/cmake/cmake/issues/17750 TEST PLAN Projects like plasma-desktop still build as before. Editing desktop files/JSON files still results in same (broken) rebuild behaviour. REPOSITORY R244 KCoreAddons BRANCH removeeffectlessOBJECT_DEPENDS REVISION DETAIL https://phabricator.kde.org/D10665 AFFECTED FILES KF5CoreAddonsMacros.cmake To: kossebau, #frameworks, apol Cc: michaelh