golang: Share build cache across package builds

This also adds a config option GOLANG_BUILD_CACHE_DIR to customize the
location of the build cache directory.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
Jeffery To
2020-08-24 04:59:05 +08:00
parent 3dd55b504c
commit 9074dbd917
6 changed files with 29 additions and 35 deletions
+2 -3
View File
@@ -35,12 +35,11 @@ endef
MAKE_PATH:=$(GO_PKG_WORK_DIR_NAME)/build/src/$(GO_PKG)
MAKE_VARS += \
GOPATH=$(GO_PKG_BUILD_DIR) \
GOCACHE=$(GO_PKG_CACHE_DIR) \
GOTMPDIR=$(GO_PKG_TMP_DIR) \
GOCACHE=$(GO_BUILD_CACHE_DIR) \
GOROOT_FINAL=$(GO_TARGET_ROOT) \
CC=$(TARGET_CC) \
CXX=$(TARGET_CXX) \
$(call GoPackage/Environment)
$(GO_PKG_VARS)
MAKE_FLAGS += \
COMMIT=$(PKG_SOURCE_VERSION)