get back ccache support

tmp/arduino-cli-pre-rebase
Jesse Vincent 4 years ago
parent 3a68baca25
commit 306a9f45fd
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -17,4 +17,6 @@ ln -s /kaleidoscope/hardware/keyboardio/virtual/libraries/Kaleidoscope \
cd /kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope cd /kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope
export ARDUINO_DIRECTORIES_DATA=/arduino-cli/data export ARDUINO_DIRECTORIES_DATA=/arduino-cli/data
export KALEIDOSCOPE_CCACHE=1
/bin/bash -c "$*" /bin/bash -c "$*"

@ -61,6 +61,10 @@ _arduino_prop = $(subst $1=,,$(subst 🔥, ,$(filter $1=%,$(_arduino_props))))
# How to use_arduino_prop # How to use_arduino_prop
# $(call _arduino_prop,recipe.hooks.sketch.prebuild.2.pattern) # $(call _arduino_prop,recipe.hooks.sketch.prebuild.2.pattern)
ifneq ($(KALEIDOSCOPE_CCACHE),)
ccache_wrapper_property := --build-properties "compiler.wrapper.cmd=ccache"
endif
.PHONY: configure-arduino-cli install-arduino-core-kaleidoscope install-arduino-core-avr .PHONY: configure-arduino-cli install-arduino-core-kaleidoscope install-arduino-core-avr
non-goal: non-goal:

@ -134,7 +134,7 @@ compile:
--output-dir "${OUTPUT_PATH}" \ --output-dir "${OUTPUT_PATH}" \
--build-cache-path "${CORE_CACHE_PATH}" \ --build-cache-path "${CORE_CACHE_PATH}" \
--build-properties "compiler.cpp.extra_flags=${LOCAL_CFLAGS}" \ --build-properties "compiler.cpp.extra_flags=${LOCAL_CFLAGS}" \
--warnings all ${ARDUINO_VERBOSE} \ --warnings all ${ARDUINO_VERBOSE} ${ccache_wrapper_property} \
"${SKETCH_FILE_PATH}" "${SKETCH_FILE_PATH}"
ifeq ($(LIBONLY),) ifeq ($(LIBONLY),)
@cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.hex" "${HEX_FILE_PATH}" @cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.hex" "${HEX_FILE_PATH}"

@ -13,6 +13,11 @@ BARE_CXX_FILES := $(foreach path,${CXX_FILES},$(notdir ${path}))
OBJ_FILES := $(patsubst %.cpp,${OBJ_DIR}/%.o,$(BARE_CXX_FILES)) OBJ_FILES := $(patsubst %.cpp,${OBJ_DIR}/%.o,$(BARE_CXX_FILES))
LIB_FILE := libcommon.a LIB_FILE := libcommon.a
ifneq ($(KALEIDOSCOPE_CCACHE),)
COMPILER_WRAPPER := ccache
endif
.PHONY: all .PHONY: all
DEFAULT_GOAL: all DEFAULT_GOAL: all
@ -26,7 +31,7 @@ ${LIB_DIR}/${LIB_FILE}: ${OBJ_FILES}
${OBJ_DIR}/%.o: ${top_dir}/testing/%.cpp ${H_FILES} ${OBJ_DIR}/%.o: ${top_dir}/testing/%.cpp ${H_FILES}
$(info compile $@) $(info compile $@)
@install -d "${OBJ_DIR}" @install -d "${OBJ_DIR}"
g++ -o "$@" -c \ $(COMPILER_WRAPPER) g++ -o "$@" -c \
-std=c++14 \ -std=c++14 \
-I${top_dir} \ -I${top_dir} \
-I${top_dir}/src \ -I${top_dir}/src \

@ -12,6 +12,10 @@ COMMON_LIB_DIR := ${top_dir}/_build/lib
include $(top_dir)/etc/makefiles/arduino-cli.mk include $(top_dir)/etc/makefiles/arduino-cli.mk
ifneq ($(KALEIDOSCOPE_CCACHE),)
COMPILER_WRAPPER := ccache
endif
SRC_DIR := test SRC_DIR := test
@ -57,7 +61,7 @@ compile-sketch:
OUTPUT_PATH="${LIB_DIR}" \ OUTPUT_PATH="${LIB_DIR}" \
VERBOSE=${VERBOSE} \ VERBOSE=${VERBOSE} \
$(MAKE) -f ${top_dir}/testing/makefiles/delegate.mk compile $(MAKE) -f ${top_dir}/testing/makefiles/delegate.mk compile
$(call _arduino_prop,compiler.cpp.cmd) -o "${BIN_DIR}/${BIN_FILE}" \ $(CCACHE) $(call _arduino_prop,compiler.cpp.cmd) -o "${BIN_DIR}/${BIN_FILE}" \
-lpthread \ -lpthread \
-g \ -g \
-w \ -w \
@ -89,7 +93,7 @@ endif
${OBJ_DIR}/%.o: ${SRC_DIR}/%.cpp ${OBJ_DIR}/%.o: ${SRC_DIR}/%.cpp
@echo "compile $@" @echo "compile $@"
install -d "${OBJ_DIR}" install -d "${OBJ_DIR}"
$(call _arduino_prop,compiler.cpp.cmd) -o "$@" -c \ $(CCACHE) $(call _arduino_prop,compiler.cpp.cmd) -o "$@" -c \
-std=c++14 \ -std=c++14 \
-I${top_dir} \ -I${top_dir} \
-I${top_dir}/src \ -I${top_dir}/src \

Loading…
Cancel
Save