Skip to content

Commit

Permalink
ci: use ccache for building cheerp-compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyxogen authored and yuri91 committed Nov 2, 2023
1 parent f9252ec commit 54b6ed0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -63,6 +77,7 @@ jobs:
resource_class: large
environment:
- NINJA_STATUS: "[%u/%r/%f] "
- CCACHE_DISABLE: 1
steps:
- attach_workspace:
at: ~/project/packages
Expand Down
7 changes: 7 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 54b6ed0

Please sign in to comment.