User can enable ccache using --compiler-launcher=ccache scons option.
When user specifies --build-3rdparty=<dependencies>, and ccache is enabled, we automatically use ccache for almost all dependencies. However, we don't enable ccache for gengetopt and ragel. See build-3rdparty.py script.
The reason is that gengetopt and ragel are tools needed during build. Unlike other dependencies, they're not cross-compiled. Instead, they are built natively and then scons is using them. Because of that, build-3rdparty.py doesn't provide CC and CXX vars when it builds gengetopt and ragel, and so there is no place where it could inject ccache.
So the fix is straightforward:
teach build-3rdparty.py to detect CC and CXX for gengetopt and ragel (it should check if gcc/clang/cc is available in PATH and use it)
if ccache is enabled (i.e. COMPILER_LAUNCHER is set), add it to CC and CXX (e.g. CC=gcc becomes CC="ccache gcc")
User can enable ccache using
--compiler-launcher=ccache
scons option.When user specifies
--build-3rdparty=<dependencies>
, and ccache is enabled, we automatically use ccache for almost all dependencies. However, we don't enable ccache forgengetopt
andragel
. See build-3rdparty.py script.The reason is that gengetopt and ragel are tools needed during build. Unlike other dependencies, they're not cross-compiled. Instead, they are built natively and then scons is using them. Because of that,
build-3rdparty.py
doesn't provideCC
andCXX
vars when it builds gengetopt and ragel, and so there is no place where it could injectccache
.So the fix is straightforward:
build-3rdparty.py
to detect CC and CXX for gengetopt and ragel (it should check if gcc/clang/cc is available in PATH and use it)CC=gcc
becomesCC="ccache gcc"
)See also #638.