From 8dd5db85dd95b58a34ded1372843ac79178beba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 19 Apr 2021 14:36:53 +0200 Subject: [PATCH] build: Pass CCACHE environment variable to the container build. --- build/makefile_base.mak | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/makefile_base.mak b/build/makefile_base.mak index 888873ec..2993fd27 100644 --- a/build/makefile_base.mak +++ b/build/makefile_base.mak @@ -45,10 +45,14 @@ include $(SRC)/make/rules-winemaker.mk include $(SRC)/make/rules-cargo.mk # If CC is coming from make's defaults or nowhere, use our own default. Otherwise respect environment. +CCACHE_ENV := $(patsubst %,-e %,$(shell env|cut -d= -f1|grep '^CCACHE_')) ifeq ($(ENABLE_CCACHE),1) CCACHE_BIN := ccache + export CCACHE_DIR := $(if $(CCACHE_DIR),$(CCACHE_DIR),$(HOME)/.ccache) + DOCKER_OPTS := $(CCACHE_ENV) -e CCACHE_DIR=$(CCACHE_DIR) $(DOCKER_OPTS) else - export CCACHE_DISABLE = 1 + export CCACHE_DISABLE := 1 + DOCKER_OPTS := $(CCACHE_ENV) -e CCACHE_DISABLE=1 $(DOCKER_OPTS) endif DOCKER_BASE = docker run --rm -e HOME -e USER -e USERID=$(shell id -u) -u $(shell id -u):$(shell id -g) \