summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-03-15 03:31:19 -0700
committerAndroid Code Review <code-review@android.com>2011-03-15 03:31:19 -0700
commitf8f95fc8b1a1eb19812fc55b230da3bfbe5272e5 (patch)
treed474c62a048d6ffb6f9999c5f594db802e681d62 /core
parente84739e942d19955248e1fc1ce966d56543eaf0e (diff)
parent55aad0866382e89a18d5cc49ce2c88c839b88cea (diff)
downloadbuild-f8f95fc8b1a1eb19812fc55b230da3bfbe5272e5.zip
build-f8f95fc8b1a1eb19812fc55b230da3bfbe5272e5.tar.gz
build-f8f95fc8b1a1eb19812fc55b230da3bfbe5272e5.tar.bz2
Merge "Allow win_sdk build with USE_CCACHE=1"
Diffstat (limited to 'core')
-rw-r--r--core/combo/select.mk24
1 files changed, 17 insertions, 7 deletions
diff --git a/core/combo/select.mk b/core/combo/select.mk
index c886342..d486255 100644
--- a/core/combo/select.mk
+++ b/core/combo/select.mk
@@ -62,13 +62,23 @@ $(combo_target)PRELINKER_MAP := $(BUILD_SYSTEM)/prelink-$(combo_os_arch).map
include $(BUILD_COMBOS)/$(combo_target)$(combo_os_arch).mk
ifneq ($(USE_CCACHE),)
- ccache := prebuilt/$(HOST_PREBUILT_TAG)/ccache/ccache
- # prepend ccache if necessary
- ifneq ($(ccache),$(firstword $($(combo_target)CC)))
- $(combo_target)CC := $(ccache) $($(combo_target)CC)
+ CCACHE_HOST_TAG := $(HOST_PREBUILT_TAG)
+ # If we are cross-compiling Windows binaries on Linux
+ # then use the linux ccache binary instead.
+ ifeq ($(HOST_OS)-$(BUILD_OS),windows-linux)
+ CCACHE_HOST_TAG := linux-$(BUILD_ARCH)
endif
- ifneq ($(ccache),$(firstword $($(combo_target)CXX)))
- $(combo_target)CXX := $(ccache) $($(combo_target)CXX)
+ ccache := prebuilt/$(CCACHE_HOST_TAG)/ccache/ccache
+ # Check that the executable is here.
+ ccache := $(strip $(wildcard $(ccache)))
+ ifdef ccache
+ # prepend ccache if necessary
+ ifneq ($(ccache),$(firstword $($(combo_target)CC)))
+ $(combo_target)CC := $(ccache) $($(combo_target)CC)
+ endif
+ ifneq ($(ccache),$(firstword $($(combo_target)CXX)))
+ $(combo_target)CXX := $(ccache) $($(combo_target)CXX)
+ endif
+ ccache =
endif
- ccache =
endif