0

It's not an option for me to modify the complicated nest of makefiles that builds our code, and in various places they construct absolute paths to very specific compilers, e.g. /home/arm2gcc/gcc-arm-none-eabi-8-2018-q4-major/bin/arm-none-eabi-gcc

That makes it hard to use ccache either as a prefix or by putting it first in the path.

So I wonder about moving the compiler installations on my personal machine to e.g. /home/arm2gcc-real and putting fake scripts in /home/arm2gcc that redirect to the real compilers.

Can anyone suggest how to do this? Or is there a better way?

2 Answers2

0

Disclaimer: I've only limited experience with Ccache and CMake.

Can you try adding this in the root CMakeLists.txt file:

find_program(CCACHE ccache)
if(CCACHE)
    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
endif()

If that does not work, I think we may need some more info on how the compilers are setup exactly in your CMakeLists.txt files.

Maarten Bamelis
  • 2,243
  • 19
  • 32
0

I suggest:

mv .../bin/arm-none-eabi-gcc .../bin/arm-none-eabi-gcc.real

Then, create a script to replace .../bin/arm-none-eabi-gcc with this content:

#!/bin/sh
exec ccache ${0}.real "$@"
Jérôme Pouiller
  • 9,249
  • 5
  • 39
  • 47