Add ccache support

Authored by ckertesz on Aug 13 2017, 2:19 PM.

Description

Add ccache support

Details

Auditors
rkflx
Committed
ckerteszSep 25 2017, 9:08 PM
Parents
R260:144f440cb76c: Always show image rotation buttons in Image Operations sidebar when other…
Branches
Unknown
Tags
Unknown
rkflx raised a concern with this commit.Sep 26 2017, 9:14 AM
rkflx added an auditor: cfeck.
rkflx added a subscriber: rkflx.

Couldn't find a Gwenview Diff in Phab, so commenting here. A short search on StackOverflow suggested to just use -DCMAKE_CXX_COMPILER_LAUNCHER=ccache. Is there any advantage to your approach I don't see yet?

Ideally this should be implemented for all KDE software at a central place (I see it was also added to KStars in D5988, though this is accepted but not closed yet?). If the CMake flag is enough indeed, both commits could be reverted in favour of adding such information to KDE's wiki.

This commit now requires audit.Sep 26 2017, 9:14 AM

Sorry, I did not know that I must/can reference PRs in the git commits. The ccache PR was this for Gwenview:

https://phabricator.kde.org/D7288

Please read the comments also there. This blog post goes into depth about ccache+CMake:

https://crascit.com/2016/04/09/using-ccache-with-cmake/

In short: My solution works with all CMake versions, CMAKE_CXX_COMPILER_LAUNCHER is available only for CMake 3.4 and above.

And I also commented in email to Christoph Feck about his comment to move this ccache support to extra-cmake-modules:

It is generic, but I don't know how "extra-cmake-modules" work. Can it be moved exactly, conditional on Unix/Apple and a CMake variable (CCACHE_SUPPORT)? Would it be enabled/included by default or the developers should know some special "cmake include statement"?

rkflx accepted this commit.Sep 27 2017, 12:00 AM

Sorry, I did not know that I must/can reference PRs in the git commits.

No problem :) For future Diffs, I can highly recommend to setup Arcanist. Then arc land will automatically add the reference to the commit as well as properly close the Phab Diff.

My solution works with all CMake versions, CMAKE_CXX_COMPILER_LAUNCHER is available only for CMake 3.4 and above.

Fair enough. As I could not find a minimum CMake version for KDE in general, I guess this can stay for now.

move this ccache support to extra-cmake-modules:

That would be the best solution, but I can understand if you don't want to work on that for now. Also I'm not sure who would develop on a distro with such an old version of CMake anyway: I checked Ubuntu 16.04 and all supported openSUSE versions, those all have at least CMake 3.5. So maybe not worth the hassle?

I don't know how "extra-cmake-modules" work

If you are interested, you could read the manual and ask on the kde-buildsystem mailing list or on IRC if you have more questions.

rkflx removed an auditor: cfeck.Oct 2 2017, 7:53 PM
All concerns with this commit have now been addressed.Oct 2 2017, 7:53 PM