Merge pull request #3722 from akallabeth/ccache_support

Added CCACHE detection and option to disable.
This commit is contained in:
Martin Fleisz 2017-01-26 11:09:16 +01:00 committed by GitHub
commit 77dc8ad9ff
5 changed files with 18 additions and 1 deletions

View File

@ -107,6 +107,12 @@ if(CMAKE_CROSSCOMPILING)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
endif(CMAKE_CROSSCOMPILING)
find_program(CCACHE ccache)
if(CCACHE AND WITH_CCACHE)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
endif(CCACHE AND WITH_CCACHE)
include(GetGitRevisionDescription)
git_get_exact_tag(GIT_REVISION --tags --always)

View File

@ -128,6 +128,7 @@ option(WITH_DEBUG_XV "Print XVideo debug messages" ${DEFAULT_DEBUG_OPTION})
option(WITH_DEBUG_RINGBUFFER "Enable Ringbuffer debug messages" ${DEFAULT_DEBUG_OPTION})
option(WITH_DEBUG_SYMBOLS "Pack debug symbols to installer" OFF)
option(WITH_CCACHE "Use ccache support if available" ON)
if(ANDROID)
include(ConfigOptionsAndroid)

View File

@ -11,6 +11,10 @@ if [ -z $NDK_TARGET ]; then
NDK_TARGET=21
fi
if [ -z $CCACHE ]; then
CCACHE=$(which ccache)
fi
if [ -z $ANDROID_NDK ]; then
ANDROID_NDK="missing"
fi

View File

@ -11,6 +11,12 @@ function build {
PATH=$ANDROID_NDK:$PATH
MAKE="make PATH=$PATH OS=android NDKROOT=$ANDROID_NDK TARGET=android-$2 NDKLEVEL=$2 ARCH=$1 -j libraries"
common_run git clean -xdf
common_run export QUIET_AR="$CCACHE "
common_run export QUIET_ASM="$CCACHE "
common_run export QUIET_CC="$CCACHE "
common_run export QUIET_CCAR="$CCACHE "
common_run export QUIET_CXX="$CCACHE "
common_run $MAKE
# Install creates a non optimal directory layout, fix that
common_run $MAKE PREFIX=$BUILD_SRC/libs/$1 install

View File

@ -30,7 +30,7 @@ function build {
common_run export CROSS_SYSROOT=$ANDROID_NDK/platforms/android-$NDK_TARGET/$PLATFORM_PREFIX
common_run export ANDROID_DEV=$ANDROID_NDK/platforms/android-$NDK_TARGET/$PLATFORM_PREFIX/usr
common_run export CROSS_COMPILE=$ARCH_PREFIX
common_run export CROSS_COMPILE="$CCACHE $ARCH_PREFIX"
common_run export PATH=$ANDROID_NDK/toolchains/$TOOLCHAIN_PREFIX$COMPILER/prebuilt/$HOST_PLATFORM/bin/:$ORG_PATH
echo "CONFIG=$CONFIG"