From e01798d1ed4df147c7eca0bbc16d95d80becc9a8 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Fri, 17 Jul 2015 23:21:01 +0200 Subject: [PATCH] LP-41 - Add support for ccache - explicitly define QMAKE_CC & CXX as "ccache " - use ccache for uavobjectgenerator - Handle CCACHE setting with configuration options To enable ccache you need to configure it like make CCACHE=/path/to/ccache config_append --- ground/openpilotgcs/openpilotgcs.pri | 6 ++++++ ground/uavobjgenerator/uavobjgenerator.pro | 4 ++++ make/firmware-defs.mk | 4 ++-- make/tools.mk | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/openpilotgcs.pri b/ground/openpilotgcs/openpilotgcs.pri index 525b8a63f..caecdbf50 100644 --- a/ground/openpilotgcs/openpilotgcs.pri +++ b/ground/openpilotgcs/openpilotgcs.pri @@ -248,3 +248,9 @@ macx { QMAKE_CXXFLAGS_WARN_ON += -Wno-gnu-static-float-init } } + + +# use ccache when available +QMAKE_CC = $$(CCACHE) $$QMAKE_CC +QMAKE_CXX = $$(CCACHE) $$QMAKE_CXX + diff --git a/ground/uavobjgenerator/uavobjgenerator.pro b/ground/uavobjgenerator/uavobjgenerator.pro index ae8c9fd25..4a03832df 100644 --- a/ground/uavobjgenerator/uavobjgenerator.pro +++ b/ground/uavobjgenerator/uavobjgenerator.pro @@ -8,6 +8,10 @@ QT -= gui macx { QMAKE_CXXFLAGS += -fpermissive } +# use ccache when available +QMAKE_CC = $$(CCACHE) $$QMAKE_CC +QMAKE_CXX = $$(CCACHE) $$QMAKE_CXX + TARGET = uavobjgenerator CONFIG += console CONFIG -= app_bundle diff --git a/make/firmware-defs.mk b/make/firmware-defs.mk index ee434895d..ec1a0e1a9 100644 --- a/make/firmware-defs.mk +++ b/make/firmware-defs.mk @@ -21,8 +21,8 @@ ifndef TOP_LEVEL_MAKEFILE endif # Define toolchain component names. -CC = $(ARM_SDK_PREFIX)gcc -CXX = $(ARM_SDK_PREFIX)g++ +CC = $(CCACHE) $(ARM_SDK_PREFIX)gcc +CXX = $(CCACHE) $(ARM_SDK_PREFIX)g++ AR = $(ARM_SDK_PREFIX)ar OBJCOPY = $(ARM_SDK_PREFIX)objcopy OBJDUMP = $(ARM_SDK_PREFIX)objdump diff --git a/make/tools.mk b/make/tools.mk index aa7f79ab7..6eb15d5fd 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -204,6 +204,8 @@ endif # Command to extract version info data from the repository and source tree export VERSION_INFO = $(PYTHON) $(ROOT_DIR)/make/scripts/version-info.py --path=$(ROOT_DIR) +export CCACHE + ############################## # # Misc settings