We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4321 - Suggestion: Add ccache to the CMake build to speed up compile time when developing
Summary: Suggestion: Add ccache to the CMake build to speed up compile time when devel...
Status: RESOLVED WONTFIX
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: don't know
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-17 14:58 UTC by Linus Probert
Modified: 2018-12-08 04:12 UTC (History)
3 users (show)

See Also:


Attachments
Use ccache for cmake build if it's available. (1.48 KB, patch)
2018-10-17 14:58 UTC, Linus Probert
Details | Diff
Patch with and option to enable ccache (2.00 KB, patch)
2018-11-03 10:14 UTC, Linus Probert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Linus Probert 2018-10-17 14:58:52 UTC
Created attachment 3380 [details]
Use ccache for cmake build if it's available.

Perhaps it just me but I like to use CCache when developing because it has a great impact on compile time for repeated builds during development.

It would be nice if SDL would use this if available.

Attaching a patch.
Comment 1 Ozkan Sezer 2018-10-17 16:14:02 UTC
This might be interesting for some, but for me I'd like to
have a way to not use it if this gets accepted  (something
other than `yum remove ccache` of course.)
Comment 2 Linus Probert 2018-10-17 16:26:43 UTC
If this is up for acceptance I can add an opt-in/opt-out flag to the script so that it remains optional.
Comment 3 Ozkan Sezer 2018-10-17 18:06:25 UTC
Not my decision.  (I just wrote that, because, as you
can guess I don't like ccache :))
Comment 4 Linus Probert 2018-10-17 18:53:18 UTC
Your request makes sense, it's silly to force stuff on people.
Comment 5 Sam Lantinga 2018-11-03 00:26:08 UTC
Yes, can you add a way to make it optional?

Thanks!
Comment 6 Linus Probert 2018-11-03 10:14:14 UTC
Created attachment 3437 [details]
Patch with and option to enable ccache

Uploaded patch that includes an option for ccache in CMakeLists.txt
Comment 7 Ryan C. Gordon 2018-12-07 19:17:22 UTC
(In reply to Linus Probert from comment #6)
> Created attachment 3437 [details]
> Patch with and option to enable ccache
> 
> Uploaded patch that includes an option for ccache in CMakeLists.txt

Fwiw, with CMake 3.4 and later, you can do this...

    cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache

...and it'll use ccache when building SDL. Considering that, I don't think we need to patch this into SDL's project files.

--ryan.
Comment 8 Linus Probert 2018-12-07 23:35:59 UTC
Oh, cool. That was new knowledge to me. That makes this patch super redundant
Comment 9 Ryan C. Gordon 2018-12-08 04:12:52 UTC
(In reply to Linus Probert from comment #8)
> Oh, cool. That was new knowledge to me. That makes this patch super redundant

We appreciate that you took the time to work on it, though!

--ryan.