Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d99981e6 authored by Matt Mower's avatar Matt Mower Committed by Steve Kondik
Browse files

build: Enable custom ccache cache dir for Android

During lunch, check environment variables for ANDROID_CCACHE_DIR.
If it is specified, CCACHE_DIR is set to match. Prevents issues
with multiple versions of ccache writing to the same cache dir.

ANDROID_CCACHE_SIZE should also be specified, allowing for a distinct
cache directory size from the default. Syntax for ANDROID_CCACHE_SIZE
is the same as applied in the command: 'ccache -M$ANDROID_CCACHE_SIZE'

Change-Id: I17497a6f56347850e0fa7b8ebd4de0b5a0b13e55
parent 8e4949da
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -49,6 +49,12 @@ ifneq ($(filter-out false,$(USE_CCACHE)),)
    ifndef CXX_WRAPPER
      CXX_WRAPPER := $(ccache)
    endif
    ifeq ($(ANDROID_CCACHE_DIR), $(CCACHE_DIR))
      ifneq ($(ANDROID_CCACHE_SIZE),)
        ACCSIZE_RESULT := $(shell $(ccache) -M$(ANDROID_CCACHE_SIZE))
      endif
    endif
    ccache =
    ACCSIZE_RESULT =
  endif
endif
+4 −0
Original line number Diff line number Diff line
@@ -283,6 +283,10 @@ function setpaths()
    unset ANDROID_HOST_OUT
    export ANDROID_HOST_OUT=$(get_abs_build_var HOST_OUT)

    if [ -n "$ANDROID_CCACHE_DIR" ]; then
        export CCACHE_DIR=$ANDROID_CCACHE_DIR
    fi

    # needed for building linux on MacOS
    # TODO: fix the path
    #export HOST_EXTRACFLAGS="-I "$T/system/kernel_headers/host_include