Skip to content

Commit

Permalink
Windows: Fix Caching
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Aug 4, 2024
1 parent b6f18f1 commit 1627bed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ jobs:
shell: cmd

env:
ARTIFACT: QGroundControl-installer.exe
QT_VERSION: 6.6.3
GST_VERSION: 1.22.11
ARTIFACT: QGroundControl-installer.exe
SCCACHE_GHA_ENABLED: "true"

steps:
- name: Checkout repo
Expand All @@ -48,7 +49,7 @@ jobs:

- name: Install Dependencies
run: |
choco install --no-progress sccache ninja -y
choco install --no-progress ninja sccache -y
choco install --no-progress cmake --installargs 'ADD_CMAKE_TO_PATH=System' --apply-install-arguments-to-dependencies
- name: Install Vulkan
Expand All @@ -68,7 +69,6 @@ jobs:
- name: Set Up Cache
uses: hendrikmuhs/[email protected]
with:
create-symlink: true
key: ${{ runner.os }}-${{ matrix.BuildType }}
restore-keys: ${{ runner.os }}-${{ matrix.BuildType }}
max-size: 1G
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,20 @@ if(UNIX)
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
endif()
elseif(WIN32)
# find_program(SCCACHE_PROGRAM sccache)
find_program(SCCACHE_PROGRAM sccache)
if(SCCACHE_PROGRAM)
message(STATUS "Using SCCache")
set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE_PROGRAM})
set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE_PROGRAM})
if(MSVC)
string(APPEND CMAKE_CXX_FLAGS " /FS")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
endif()
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
endif()
endif()
endif()
Expand Down

0 comments on commit 1627bed

Please sign in to comment.