6

I'm trying to set up ccache in Qt Creator on Windows.

Unfortunatelly I couldn't find any good instruction. How to make it working?

I have ccache installed with Cygwin.

edit:

I've tried adding

QMAKE_CXX+="ccache g++"

as additional parameter in qmake build step.

But in compile output I still have "g++ -c -g -Wall ..." and I suppose it should be "ccache g++ ..."

krzych
  • 2,126
  • 7
  • 31
  • 50

2 Answers2

12

It should be:

"QMAKE_CXX=ccache g++"

And you might need to rerun qmake from the Build menu if QtCreator doesn't update automatically the makefile after you add that parameter.

alexisdm
  • 29,448
  • 6
  • 64
  • 99
  • I also must set CCACHE_DIR in Windows cause ccache was unable to create $HOME/.ccache – krzych Jul 10 '12 at 06:19
  • 2
    If you don't want to hardcode the compiler you can use `QMAKE_CXX="ccache $$QMAKE_CXX"` to prefix the existing setting. – Zitrax May 23 '18 at 10:00
  • i also must remove precompiled header. In qt it's particularly removing the line: "PRECOMPILED_HEADER=MY_PRECOMP.HPP" – seleciii44 Feb 08 '19 at 04:12
  • @alexisdm I am confused, why do you show the quotes including QMAKE, while other answers show quotes only including the```ccache g++``` part? – Tyler Shellberg Mar 17 '20 at 22:21
-1

QtCreator doesn't know about ccache, and besides, it's looking for trouble to mix Cygwin binaries with native binaries on Windows.

darkphoenix
  • 2,147
  • 3
  • 13
  • 14