aboutsummaryrefslogtreecommitdiffstats
path: root/include/cmake.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-07-24 08:34:08 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-07-24 08:34:08 +0000
commit6d14097297fa7de59b301c40a22689bca3cda77f (patch)
tree223455c3228c336142713a9bec5542fd371ca345 /include/cmake.mk
parent4417ab46f223a33c76374c3d7ed2024e8e48a446 (diff)
downloadupstream-6d14097297fa7de59b301c40a22689bca3cda77f.tar.gz
upstream-6d14097297fa7de59b301c40a22689bca3cda77f.tar.bz2
upstream-6d14097297fa7de59b301c40a22689bca3cda77f.zip
cmake: fix ccache command when using host ccache (patch from #9611)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27742 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include/cmake.mk')
-rw-r--r--include/cmake.mk8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/cmake.mk b/include/cmake.mk
index 6c5b5eb4f7..ad9744d3fd 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -15,9 +15,13 @@ ifeq ($(CONFIG_CCACHE),)
CMAKE_CXX_COMPILER_ARG1:=
endif
else
- CMAKE_C_COMPILER:=$(STAGING_DIR_HOST)/bin/ccache
+ CCACHE:=$(shell which ccache)
+ ifeq ($(CCACHE),)
+ CCACHE:=$(STAGING_DIR_HOST)/bin/ccache
+ endif
+ CMAKE_C_COMPILER:=$(CCACHE)
CMAKE_C_COMPILER_ARG1:=$(filter-out ccache,$(TARGET_CC))
- CMAKE_CXX_COMPILER:=$(STAGING_DIR_HOST)/bin/ccache
+ CMAKE_CXX_COMPILER:=$(CCACHE)
CMAKE_CXX_COMPILER_ARG1:=$(filter-out ccache,$(TARGET_CXX))
endif