Skip to content

Commit d2c897a

Browse files
committed
[windows][build] pass the /debug flag to the linker
when building with debug information enabled This ensures that every executable and dll get a corresponding PDB file with the debug information.
1 parent 1f9b074 commit d2c897a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

utils/build.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,12 @@ function Build-CMakeProject {
585585
TryAdd-KeyValue $Defines CMAKE_MT "mt"
586586

587587
$CFlags = @("/GS-", "/Gw", "/Gy", "/Oi", "/Oy", "/Zc:inline")
588-
if ($DebugInfo) { $CFlags += if ($EnableCaching) { "/Z7" } else { "/Zi" } }
588+
if ($DebugInfo) {
589+
$CFlags += if ($EnableCaching) { "/Z7" } else { "/Zi" }
590+
# Add additional linker flags for generating the debug info.
591+
Append-FlagsDefine $Defines CMAKE_SHARED_LINKER_FLAGS "/debug"
592+
Append-FlagsDefine $Defines CMAKE_EXE_LINKER_FLAGS "/debug"
593+
}
589594
$CXXFlags = $CFlags.Clone() + "/Zc:__cplusplus"
590595

591596
if ($EnableCaching) {

0 commit comments

Comments
 (0)