pkg-cmake.mk: enable ccache for cmake packages
authorSamuel Martin <s.martin49@gmail.com>
Sun, 1 Jun 2014 09:24:25 +0000 (11:24 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 1 Jun 2014 20:16:24 +0000 (22:16 +0200)
commitc8f2d248f65067979f9b7da25ee2469ae020ec1b
tree455a4c582f84b4125a7e5ecf59b3110ec1bf0318
parent9033d90118689a50b13b3764a927ec1b202624bf
pkg-cmake.mk: enable ccache for cmake packages

This patch updates the generated toolchainfile.cmake to use ccache.

When toolchainfile.cmake is used inside Buildroot, using ccache during
the build is driven by a CMake knob: USE_CCACHE, automatically set by
the cmake-package infrastructure and reflecting the BR2_CCACHE value.

Since this toolchainefile.cmake file can be used outside Buildroot, and
this file also set a couple of things (among these: the sysroot cflag,
some pkg-config environment variables), it is important to set the
compiler variables as well to keep the consistency of the
cross-compilation configuration.
So, when it is used outside Buildroot, using ccache for the build is
driven by the ccache program availability.

Note that using ccache for the build is achieved by setting the *_ARG1
CMake variables to let CMake use ccache without failing in detecting
the compiler.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/pkg-cmake.mk
support/misc/toolchainfile.cmake.in