From 54b6ed0cc04d0b8d541190136402697fb6e4f260 Mon Sep 17 00:00:00 2001 From: Hyxogen <8938732+Hyxogen@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:49:19 +0100 Subject: [PATCH] ci: use ccache for building cheerp-compiler --- .circleci/config.yml | 15 +++++++++++++++ debian/rules | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b33ebfec91f7..b40ccf451a62 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,9 +27,18 @@ jobs: environment: - NINJA_STATUS: "[%u/%r/%f] " - THREADS: "6" + - CCACHE_DIR: "/ccache" steps: - attach_workspace: at: ~/project/packages + - run: + name: Setup ccache + command: | + mkdir /ccache + - restore_cache: + name: Restore ccache + keys: + - cheerp-compiler - run: name: Clone Cheerp command: | @@ -48,6 +57,11 @@ jobs: - build-internal: directory: cheerp-compiler package-name: llvm-clang + - save_cache: + name: Save ccache + key: cheerp-compiler + paths: + - /ccache - run: name: Save build working_directory: ~/project/cheerp-compiler @@ -63,6 +77,7 @@ jobs: resource_class: large environment: - NINJA_STATUS: "[%u/%r/%f] " + - CCACHE_DISABLE: 1 steps: - attach_workspace: at: ~/project/packages diff --git a/debian/rules b/debian/rules index e3f901f05f7f..a602c66117c5 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,13 @@ deb_version := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p') ifndef CIRCLECI FLAGS_RELEASE="-DNDEBUG -O2" + USE_CCACHE=Off else + ifeq (${CIRCLE_BRANCH}, master) + USE_CCACHE=Off + else + USE_CCACHE=On + endif FLAGS_RELEASE="-O2" endif @@ -25,6 +31,7 @@ override_dh_auto_configure: -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld \ -DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld \ + -DLLVM_CCACHE_BUILD=${USE_CCACHE} override_dh_auto_install: cd build && DESTDIR=${PWD}/debian/tmp ninja install-distribution