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

Commit b9c8dec8 authored by Anthony King's avatar Anthony King Committed by Gerrit Code Review
Browse files

build: use the system's ccache by default

* ccache gets updated semi-frequently and some builders would like
  to be able to take advantage of new features without having to
  rely on the prebuilt version getting updated

* If a build system has ccache installed already, use that version
  instead of the prebuilt

Change-Id: I8988c8a25fab3694d84633f957c2b92ce84cf69e
parent 2d8e2fec
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -38,8 +38,14 @@ ifneq ($(filter-out false,$(USE_CCACHE)),)
  # See http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html
  export CCACHE_CPP2 := true

  # Detect if the system already has ccache installed to use instead of the prebuilt
  ccache := $(shell which ccache)

  ifeq ($(ccache),)
    CCACHE_HOST_TAG := $(HOST_PREBUILT_TAG)
    ccache := prebuilts/misc/$(CCACHE_HOST_TAG)/ccache/ccache
  endif

  # Check that the executable is here.
  ccache := $(strip $(wildcard $(ccache)))
  ifdef ccache
+8 −3
Original line number Diff line number Diff line
@@ -231,10 +231,15 @@ endif
endif

ifneq ($(USE_CCACHE),)
    # Detect if the system already has ccache installed to use instead of the prebuilt
    ccache := $(shell which ccache)

    ifeq ($(ccache),)
        ccache := $(ANDROID_BUILD_TOP)/prebuilts/misc/$(HOST_PREBUILT_TAG)/ccache/ccache
        # Check that the executable is here.
        ccache := $(strip $(wildcard $(ccache)))
    endif
endif

KERNEL_CROSS_COMPILE := CROSS_COMPILE="$(ccache) $(KERNEL_TOOLCHAIN_PATH)"
ccache =