D10450: Generate a custom target in kcoreaddons_desktop_to_json

Adriaan de Groot noreply at phabricator.kde.org
Mon Feb 12 08:53:37 UTC 2018


adridg added a comment.


  In D10450#204623 <https://phabricator.kde.org/D10450#204623>, @kossebau wrote:
  
  > "This (hopefully) fixes the build failure noticed in the FreeBSD (and some linuxes)" - leaves the question: why should it exactly fix it? :)
  
  
  From reading the CMake documentation, it seems (but I'll admit that fancy dependency stuff is a dark art in CMake) that AUTOGEN_TARGET_DEPENDS shouldn't be a **file**, but a **target**. This patch adds a target, created by the given command and hooks that into the dependency graph.
  
  > From discussion of last week on irc, it seemed that the actual problem is that the generated make files do not contain the dependency between the JSON file that needs to be generated and automoc running over the cpp source file to generate the moc file based on the referenced JSON file.
  
  And that's the whole problem, isn't it. If you force the dependency arc to be there -- i.e. by using the target property here -- then it works. Note, though, that I haven't dissected a Makefile / ninja file to see that the dependency arc is really there. We just tested it by re-running the build a couple of times on 32- and 48-core machines.
  
  > Something which e.g. is tried to be solved by the code in the `kcoreaddons_add_plugin` macro, by grepping over all the source files to find the cpp file which references the JSON file and then create the dependency by
  > 
  >   set_property(SOURCE ${dependent_sources} APPEND PROPERTY OBJECT_DEPENDS ${json})
  >    
  
  If this patch fixes the dependency arc, then possibly that (expensive?) grepping around isn't needed either.
  
  I'll try to do some Makefile-dissection.

REPOSITORY
  R244 KCoreAddons

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

To: tcberner, #freebsd, mpyne, bshah, dfaure
Cc: adridg, kossebau, #frameworks, michaelh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180212/c92678be/attachment.html>


More information about the Kde-frameworks-devel mailing list