How to config ccache for kicad under windows

76 views
Skip to first unread message

Liang Jia

unread,
May 7, 2024, 3:30:53 AM5/7/24
to KiCad Developers
Hi All,

I'm trying to speed up kicad compile time with ccache under windows.
I made a huge step with it, so I want to share my setting to the community.

Before use ccache: the compile time in my env is 20~ minutes, 
After use ccache: the compile time reduces to 3~ minutes.

Background:
There are some settings about ccache in CMakeLists.txt. but it isn't work.

if (USE_CCACHE)
  find_program(CCACHE_BINARY ccache)
  if(CCACHE_FOUND)
    get_property(RULE_LAUNCH_COMPILE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
    ...

So I tried to adapt it to my windows env.

Below is my setting:
find_program(CCACHE_FOUND ccache PATHS "D:\\ccache-4.9.1-windows-x86_64")
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_FOUND})
set(CMAKE_CXX_COMPILER_LAUNCHER ${ CCACHE_FOUND})
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
cmake_policy(SET CMP0141 NEW)


Below is my reference:

Sincerely
Liang

Mark Roszko

unread,
May 7, 2024, 8:30:47 PM5/7/24
to dev...@kicad.org
I fixed up the kicad cmakelist to be correct. The ccache and distcc logic was pretty old and dated.

You just need to have ccache on your PATH and you should not need any of your custom changes in theory now besides setting USE_CCACHE. 

--
You received this message because you are subscribed to the Google Groups "KiCad Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to devlist+u...@kicad.org.
To view this discussion on the web visit https://groups.google.com/a/kicad.org/d/msgid/devlist/CAE0Ak8aFpyDB-gkK3WA5GHWbvHcxuAgZ-jBA05Msi0S95o%3DF4w%40mail.gmail.com.

Liang Jia

unread,
May 7, 2024, 9:18:43 PM5/7/24
to dev...@kicad.org
Reply all
Reply to author
Forward
0 new messages