Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 72a80f0

Browse files
committed
Enable PDB generation for corerun and coreconsole
Corerun and coreconsole are exes, so they don't share the same linker flags as the shared libraries. Set DEBUG on the EXE flags so that Release always gets debug info. Don't pass incremental linking, incompatible with debug type
1 parent a71f071 commit 72a80f0

File tree

6 files changed

+17
-4
lines changed

6 files changed

+17
-4
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ if (WIN32)
143143
add_compile_options(/TP) # compile all files as C++
144144
add_compile_options(/FIWarningControl.h) # force include of WarningControl.h
145145
add_compile_options(/Zi) # enable debugging information
146+
add_compile_options(/d2Zi+) # make optimized builds debugging easier
146147
add_compile_options(/nologo) # Suppress Startup Banner
147148
add_compile_options(/W3) # set warning level to 3
148149
add_compile_options(/WX) # treat warnings as errors
@@ -163,7 +164,6 @@ add_compile_options(/FC) # use full pathnames in diagnostics
163164
add_compile_options(/Zl) # omit default library name in .OBJ
164165
add_compile_options(/MP) # Build with Multiple Processes (number of processes equal to the number of processors)
165166
add_compile_options(/GS) # Buffer Security Check
166-
add_compile_options(/d2Zi+) # make optimized builds debugging easier
167167
add_compile_options(/Zm200) # Specify Precompiled Header Memory Allocation Limit of 150MB
168168
add_compile_options(/wd4960 /wd4961 /wd4603 /wd4627 /wd4838 /wd4456 /wd4457 /wd4458 /wd4459 /wd4091 /we4640)
169169

@@ -192,6 +192,8 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUGTYPE:cv,fixup"
192192
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /PDBCOMPRESS") #shrink pdb size
193193
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF /IGNORE:4197,4013,4254,4070,4221")
194194

195+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG /PDBCOMPRESS")
196+
195197
# Debug build specific flags
196198
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/NOVCFEATURE")
197199

src/coreclr/hosts/coreconsole/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ else(CLR_CMAKE_PLATFORM_UNIX)
2929
# Can't compile on linux yet so only add for windows
3030
# add the install targets
3131
install (TARGETS CoreConsole DESTINATION .)
32-
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$ENV{__BuildType}/CoreConsole.pdb DESTINATION PDB CONFIGURATIONS Debug)
32+
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$ENV{__BuildType}/CoreConsole.pdb DESTINATION PDB)
3333

3434
endif(CLR_CMAKE_PLATFORM_UNIX)

src/coreclr/hosts/corerun/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ else(CLR_CMAKE_PLATFORM_UNIX)
3131
install (TARGETS CoreRun DESTINATION .)
3232

3333
# We will generate PDB only for the debug configuration
34-
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/CoreRun.pdb DESTINATION PDB CONFIGURATIONS Debug)
34+
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/CoreRun.pdb DESTINATION PDB)
3535

3636
endif(CLR_CMAKE_PLATFORM_UNIX)

src/dlls/clretwrc/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ add_custom_command(
1919
# add the install targets
2020
install (TARGETS clretwrc DESTINATION .)
2121

22+
if(WIN32)
23+
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/clretwrc.pdb DESTINATION PDB)
24+
endif(WIN32)

src/dlls/mscorrc/full/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ add_definitions(-DFX_VER_INTERNALNAME_STR=mscorrc.debug.dll)
66

77
# add the install targets
88
install (TARGETS mscorrc.debug DESTINATION .)
9+
10+
if(WIN32)
11+
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/mscorrc.debug.pdb DESTINATION PDB)
12+
endif(WIN32)

src/dlls/mscorrc/small/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ add_library(mscorrc SHARED
55
add_definitions(-DFX_VER_INTERNALNAME_STR=mscorrc.dll)
66

77
# add the install targets
8-
install (TARGETS mscorrc DESTINATION .)
8+
install (TARGETS mscorrc DESTINATION .)
9+
10+
if(WIN32)
11+
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/mscorrc.pdb DESTINATION PDB)
12+
endif(WIN32)

0 commit comments

Comments
 (0)