Skip to content

Commit fe90ed9

Browse files
committed
utils: adjust CMake flags for debug info handling
Use the new CMake options for controlling debug information generation. This matches the recommendations from sccache and avoids us trying to map flags manually.
1 parent 5aaa17f commit fe90ed9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/build.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,8 @@ function Build-CMakeProject {
581581
$UseBuiltCompilers.Contains("C") -Or $UseBuiltCompilers.Contains("CXX") -Or
582582
$UsePinnedCompilers.Contains("C") -Or $UsePinnedCompilers.Contains("CXX")) {
583583
if ($DebugInfo) {
584-
$CFlags += if ($EnableCaching) { "/Z7" } else { "/Zi" }
584+
Append-FlagsDefine $Defines CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded
585+
Append-FlagsDefine $Defines CMAKE_POLICY_CMP0141 NEW
585586
# Add additional linker flags for generating the debug info.
586587
Append-FlagsDefine $Defines CMAKE_SHARED_LINKER_FLAGS "/debug"
587588
Append-FlagsDefine $Defines CMAKE_EXE_LINKER_FLAGS "/debug"

0 commit comments

Comments
 (0)