From 3e650cf731edf89ce8647647aa39e798060cb7fa Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Thu, 29 Dec 2022 08:40:40 +0300 Subject: [PATCH] enabled ccache in CMakeLists.txt for client project --- .github/workflows/deploy.yml | 26 +++++++++++++------------- client/CMakeLists.txt | 12 +++++------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ec9fa862..e2ad4781 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,15 +27,15 @@ jobs: set-env: 'true' extra: '--external 7z' + - name: 'Setup ccache' + uses: hendrikmuhs/ccache-action@v1.2 + - name: 'Get sources' uses: actions/checkout@v3 with: submodules: 'true' fetch-depth: 10 - - name: 'Setup ccache' - uses: hendrikmuhs/ccache-action@v1.2 - - name: 'Build project' run: | export QT_BIN_DIR=${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/gcc_64/bin @@ -61,15 +61,6 @@ jobs: BUILD_ARCH: 64 steps: - - name: 'Get sources' - uses: actions/checkout@v3 - with: - submodules: 'true' - fetch-depth: 10 - - - name: 'Setup ccache' - uses: hendrikmuhs/ccache-action@v1.2 - - name: 'Install Qt' uses: jurplel/install-qt-action@v3 with: @@ -87,7 +78,16 @@ jobs: - name: 'Setup mvsc' uses: ilammy/msvc-dev-cmd@v1 with: - arch: 'x64' + arch: 'x64' + + - name: 'Setup ccache' + uses: hendrikmuhs/ccache-action@v1.2 + + - name: 'Get sources' + uses: actions/checkout@v3 + with: + submodules: 'true' + fetch-depth: 10 - name: 'Build project' shell: cmd diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index d525d165..e1d0e7d5 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -37,13 +37,11 @@ if(IOS) WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) endif() -set(IS_CI ${CI}) -if(IS_CI) - message("Detected CI env") - find_program(CCACHE "ccache") - if(CCACHE) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE}") - endif() +find_program(CCACHE_FOUND ccache) +if(CCACHE_FOUND) + message("found ccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif() include(${CMAKE_CURRENT_LIST_DIR}/cmake/3rdparty.cmake)