[lookandfeel kcm] Do not declare plugin in lookandfeeltool code version
ClosedPublic

Authored by kossebau on Feb 13 2018, 4:52 PM.

Details

Summary

Also improves race condition on creating the JSON file and running
automoc over the cpp file which refers to it, given there is no
dependency chain defined at all for the lookandfeeltool target and
that kcm_lookandfeel.json, which was prone to make highly parallel
builds fail

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Feb 13 2018, 4:52 PM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 13 2018, 4:52 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Feb 13 2018, 4:52 PM
davidedmundson accepted this revision.Feb 13 2018, 7:38 PM
davidedmundson added a subscriber: davidedmundson.

Thanks!

please close 389982

This revision is now accepted and ready to land.Feb 13 2018, 7:38 PM
This revision was automatically updated to reflect the committed changes.

Unfortunately we will have to revert this it seems,

CMakeFiles/kcm_lookandfeel.dir/kcm.cpp.o: In function `KCMLookandFeelFactory::KCMLookandFeelFactory()': 
kcm.cpp:(.text+0x2b): undefined reference to `vtable for KCMLookandFeelFactory'                         
CMakeFiles/kcm_lookandfeel.dir/kcm.cpp.o: In function `KCMLookandFeelFactory::~KCMLookandFeelFactory()':
kcm.cpp:(.text+0xad): undefined reference to `vtable for KCMLookandFeelFactory'                         
collect2: error: ld returned 1 exit status

It results in error above

Could not reproduce that error locally, and build.kde.org had also not reported any problems. But given it failed for at least two people and the neon CI (https://build.neon.kde.org/job/xenial_unstable_plasma_plasma-desktop_bin_amd64/528/consoleFull) there might be some other problem hidden somewhere.

For what I looked, all generated Make rules also looked fine here (clean build), with expected conditions. grep DEFINE_NO_PLUGIN . -R only got me hits for the lookandfeeltool targets, especially

./CMakeFiles/lookandfeeltool_autogen.dir/AutogenInfo.cmake:set(AM_MOC_DEFINITIONS "DEFINE_NO_PLUGIN;KCOREADDONS_LIB;KGUIADDONS_LIB;QT_CORE_LIB;QT_DBUS_LIB;QT_DISABLE_DEPRECATED_BEFORE=0;QT_GUI_LIB;QT_NETWORK_LIB;QT_NO_URL_CAST_FROM_STRING;QT_PRINTSUPPORT_LIB;QT_QML_LIB;QT_QUICKWIDGETS_LIB;QT_QUICK_LIB;QT_WIDGETS_LIB;QT_X11EXTRAS_LIB;QT_XML_LIB;TRANSLATION_DOMAIN=\"kcm_lookandfeel\";_GNU_SOURCE;_LARGEFILE64_SOURCE")

By the error reported it seems though the generated kcms/lookandfeel/kcm_lookandfeel_autogen/include/kcm.moc was without the code of the plugin factoy for whatever reason, where it should have it though. No idea why by just looking at the code.

Given I have no access to neon builds and also reached frustration level here :) I am now simply proposing D10607 as an alternative solution without a preprocessor definition, that should avoid any possible confusion cmake/automoc might have here.