mirror of
https://git.suyu.dev/suyu/Yucom.git
synced 2026-01-08 07:27:58 +01:00
build: Support ccache.
This commit is contained in:
parent
8828544db7
commit
24b944292e
3 changed files with 31 additions and 14 deletions
|
|
@ -38,17 +38,22 @@ endif
|
|||
|
||||
# If CC is coming from make's defaults or nowhere, use our own default. Otherwise respect environment.
|
||||
ifneq ($(filter default undefined,$(origin CC)),)
|
||||
# CC = ccache gcc
|
||||
CC = gcc
|
||||
endif
|
||||
ifneq ($(filter default undefined,$(origin CXX)),)
|
||||
# CXX = ccache g++
|
||||
CXX = g++
|
||||
endif
|
||||
|
||||
export CC
|
||||
export CXX
|
||||
|
||||
ifeq ($(ENABLE_CCACHE),1)
|
||||
export PATH := /usr/lib/ccache:$(PATH)
|
||||
else
|
||||
export CCACHE_DISABLE = 1
|
||||
DOCKER_CCACHE_FLAG = -e CCACHE_DISABLE=1
|
||||
endif
|
||||
|
||||
CC32 := gcc -m32 -mstackrealign
|
||||
CXX32 := g++ -m32 -mstackrealign
|
||||
PKG_CONFIG32 := i686-linux-gnu-pkg-config
|
||||
|
|
@ -61,7 +66,7 @@ cc-option = $(shell if test -z "`echo 'void*p=1;' | \
|
|||
DOCKER_SHELL_BASE = docker run --rm --init --privileged --cap-add=SYS_ADMIN --security-opt apparmor:unconfined \
|
||||
-v $(HOME):$(HOME) -v /tmp:/tmp \
|
||||
-v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -v /etc/shadow:/etc/shadow:ro \
|
||||
-w $(CURDIR) -e HOME=$(HOME) -e PATH=$(PATH) -u $(shell id -u):$(shell id -g) -h $(shell hostname) \
|
||||
-w $(CURDIR) -e HOME=$(HOME) -e PATH=$(PATH) $(DOCKER_CCACHE_FLAG) -u $(shell id -u):$(shell id -g) -h $(shell hostname) \
|
||||
$(DOCKER_OPTS) \
|
||||
$(SELECT_DOCKER_IMAGE) /sbin/docker-init -sg -- /bin/bash
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue