Skip to content

Commit

Permalink
fix: pin ccache version on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
luishfonseca committed Sep 26, 2023
1 parent 401fec2 commit 67acf0f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-engine-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

env:
BUILD_TYPE: Release
CCACHE_VERSION: 4.8.3
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: "${{ github.workspace }}/.ccache"
CCACHE_COMPILERTYPE: msvc
Expand All @@ -24,7 +25,7 @@ jobs:

- name: Install dependencies
run: |
choco install ccache
choco install ccache --version ${{ env.CCACHE_VERSION }}
- name: Get timestamp
shell: bash
Expand All @@ -46,7 +47,7 @@ jobs:
run: cmake -E make_directory ${{github.workspace}}\build

- name: Configure CMake
run: cmake -B ${{github.workspace}}\build -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_CORE_SAMPLES=ON -DBUILD_CORE_TESTS=ON -DBUILD_ENGINE_SAMPLES=ON -DUSE_CLANG_TIDY=OFF
run: cmake -B ${{github.workspace}}\build -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_CORE_SAMPLES=ON -DBUILD_CORE_TESTS=ON -DBUILD_ENGINE_SAMPLES=ON -DUSE_CLANG_TIDY=OFF -DCCACHE_VERSION="${{env.CCACHE_VERSION}}"

- name: CCache Prolog
run: |-
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ if(CCACHE_EXE)
option(USE_CCACHE "Enable CCache" ON)
if(USE_CCACHE)
if (CMAKE_HOST_WIN32)
option(CCACHE_VERSION "Pinned CCache Version")

# find_program only finds Chocolatey's shim which is unable to be used with another name, the original executable must be used.
set(CCACHE_PATH C:/ProgramData/chocolatey/lib/ccache/tools/ccache-${CCACHE_VERSION}-windows-x86_64/ccache.exe)

file(COPY_FILE
"C:/ProgramData/chocolatey/lib/ccache/tools/ccache-4.8.3-windows-x86_64/ccache.exe" ${CMAKE_BINARY_DIR}/cl.exe
${CCACHE_PATH} ${CMAKE_BINARY_DIR}/cl.exe
ONLY_IF_DIFFERENT)

set(CMAKE_VS_GLOBALS
Expand Down

0 comments on commit 67acf0f

Please sign in to comment.