D17647: Fix KGlobalAccel build with Qt 5.13 prerelease

Michael Pyne noreply at phabricator.kde.org
Tue Dec 18 04:03:02 GMT 2018


mpyne created this revision.
mpyne added reviewers: Frameworks, graesslin.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
mpyne requested review of this revision.

REVISION SUMMARY
  After a recent system upgrade to Qt git `dev` branch (for upcoming 5.13), kglobalaccel started to fail to build due to problems compiling a moc file. Oddly, all other frameworks in KF5 (except those depending upon kglobalaccel) compiled fine.
  
  I spent some time looking into several potential Qt moc or other issues, but to save you all the time I wasted on it, the essence is that you shouldn't `#include "foo.moc"` from within a C++ namespace. Previously this would have worked since only symbols relevant to the current C++ namespace were defined.
  
  But with updated Qt, the moc generates files that rely on parts of the C++ standard library being available, and duly includes a line `#include <memory>`. At the top namespace level this works great. Including `<memory>` from within our own namespace works less well, producing error messages that cause LLVM to give up early.
  
  I fix by just removing the entry since CMake is automoc'ing anyways. If we need to include the entry then moving it to the end of the file instead would probably work just as well. Note that moc is itself smart enough to capture the namespacing of the class we declare.

TEST PLAN
  Completed build of KGlobalAccel, installs successfully, dependent modules install successfully, new Plasma desktop loads fine.
  
  All 2 autotests still pass.

REPOSITORY
  R268 KGlobalAccel

REVISION DETAIL
  https://phabricator.kde.org/D17647

AFFECTED FILES
  src/runtime/component.cpp

To: mpyne, #frameworks, graesslin
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181218/cc631a5d/attachment.html>


More information about the Kde-frameworks-devel mailing list