2 SCRIPTDIR=$(cd $(dirname ${BASH_SOURCE[0]}); pwd -P)
3 source ${SCRIPTDIR}/common.sh
7 echo "source build/ccache_env.sh desktop|mobile|tv"
10 if ! type ccache &> /dev/null; then
11 echo "WARNING: ccache option used but ccache is not installed"
15 if [ "$1" == "tizen" -o "$1" == "desktop" -o "$1" == "crosscompile" ]; then
16 OUTPUT_BASE_FOLDER=out.${1}.$(getHostArch)
17 export CCACHE_CPP2=yes
18 export CCACHE_SLOPPINESS=time_macros
19 export CCACHE_BASEDIR=${TOPDIR}
21 if [ "$USER" == "abuild" ]; then
22 #/.ccache directory in gbs sysroot is not removed by -C option
23 #unlike /var/tmp and /tmp directories
24 #so having /.ccache as out ccache dir will make possible to use
25 #ccache also with bot incremental and non-incremental builds
26 export PATH=/var/lib/build/ccache/bin:$PATH
27 export CCACHE_DIR=/.ccache/${OUTPUT_BASE_FOLDER}
30 export CCACHE_COMPILERCHECK=content
31 CCACHESIZE=$(ccache -s | grep max | grep -oE "[0-9]+" | head -1)
32 if [ $CCACHESIZE == "1" ]; then
36 if [ "$1" == "desktop" -o "$1" == "crosscompile" ]; then
37 ccacheInPath=$(echo $PATH | grep -c /usr/lib/ccache)
38 if [ "$ccacheInPath" == "0" ]; then
39 export PATH=/usr/lib/ccache:$PATH
43 echo "Warning! You need to pick correct profile when you include ccache_env.sh"
44 echo "ccache will not be configured"