Skip to content

Commit 4612552

Browse files
bthomeemvadari
authored andcommitted
chore: Change /Zi to /Z7 for ccache, remove debug symbols in CI (#6198)
As the `/Zi` compiler flag is unsupported by ccache, this change switches it to `/Z7` instead. For CI runs all debug info is omitted.
1 parent dbfaa9e commit 4612552

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

.github/workflows/reusable-build-test-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
101101

102102
- name: Prepare runner
103-
uses: XRPLF/actions/prepare-runner@65da1c59e81965eeb257caa3587b9d45066fb925
103+
uses: XRPLF/actions/prepare-runner@121d1de2775d486d46140b9a91b32d5002c08153
104104
with:
105105
enable_ccache: ${{ inputs.ccache_enabled }}
106106

cmake/Ccache.cmake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ set(CMAKE_VS_GLOBALS
4646
"TrackFileAccess=false"
4747
"UseMultiToolTask=true")
4848

49-
# By default Visual Studio generators will use /Zi, which is not compatible with
50-
# ccache, so tell it to use /Z7 instead.
51-
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
49+
# By default Visual Studio generators will use /Zi to capture debug information,
50+
# which is not compatible with ccache, so tell it to use /Z7 instead.
51+
if (MSVC)
52+
foreach (var_
53+
CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
54+
CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE)
55+
string (REPLACE "/Zi" "/Z7" ${var_} "${${var_}}")
56+
endforeach ()
57+
endif ()

cmake/XrplCompiler.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ if (MSVC)
4444
# omit debug info completely under CI (not needed)
4545
if (is_ci)
4646
string (REPLACE "/Zi" " " ${var_} "${${var_}}")
47+
string (REPLACE "/Z7" " " ${var_} "${${var_}}")
4748
endif ()
4849
endforeach ()
4950

cspell.config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ words:
5959
- Btrfs
6060
- canonicality
6161
- checkme
62+
- choco
6263
- chrono
6364
- citardauq
6465
- clawback

0 commit comments

Comments
 (0)