1

I would like to use ccache for a build done with bjam and gcc as its toolset.

As this answer suggests ccache needs the compilation and linker call in separate steps to work correctly. However bjam is performing those in a single step.

How can I call/configure bjam to first compile and link afterwards and to work with ccache?

eL.
  • 311
  • 1
  • 2
  • 15

1 Answers1

1

Put in your ~/user-config.jam

using gcc : : ccache g++ ;

Now when you request gcc toolset (e.g. via b2 toolset=gcc) it will use the one initialized above.

ccache needs the compilation and linker call in separate steps to work correctly. However bjam is performing those in a single step

It's not true, quiet an opposite, b2 always perform compilation and likange in separate calls (there is no direct ASM/C/CPP -> LIB/EXE generators defined for any toolset).

Nikita Kniazev
  • 3,728
  • 2
  • 16
  • 30