Skip to content

Commit 521936d

Browse files
committed
Make debug build use program database
1 parent 09c1c2b commit 521936d

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

CMakePresets.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"CMAKE_VERBOSE_MAKEFILE": "TRUE",
2121
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
2222
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL",
23-
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "$<$<CONFIG:Release,Debug,RelWithDebInfo>:Embedded>",
23+
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "$<$<CONFIG:Release>:Embedded>$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>",
2424
"CMAKE_BUILD_TYPE": "Release",
2525
"RTS_FLAGS": "/W3"
2626
},
@@ -218,7 +218,8 @@
218218
"name": "vc6-debug",
219219
"configurePreset": "vc6-debug",
220220
"displayName": "Build Windows 32bit VC6 Debug",
221-
"description": "Build Windows 32bit VC6 Debug"
221+
"description": "Build Windows 32bit VC6 Debug",
222+
"jobs": 1
222223
},
223224
{
224225
"name": "win32",

cmake/vc6toolchain.cmake

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ string(JOIN " " VC6_CXX_FLAGS
3636
"/GR" # Enable RTTI (Run-Time Type Information, needed for things like dynamic_cast)
3737
"/Op" # Improve floating point consistency (More ISO-compliant and closer to 64bit behaviour)
3838
"/EHs" # Synchronous C++ exception handling (ISO-standard C++ exception handling)
39+
# "/GA" # Optimize for Windows Application (should only be set on the main executable?)
3940
# "/Za" # Disable Microsoft language extensions (enforce standard)
4041
)
4142
set(CMAKE_CXX_FLAGS "${VC6_CXX_FLAGS}" CACHE STRING "" FORCE)
@@ -46,7 +47,7 @@ string(JOIN " " VC6_CXX_FLAGS_DEBUG
4647
"/EHc-" # Do NOT assume extern "C" functions never throw (less strict, useful for debugging)
4748
"/Oy-" # Disable frame pointer omission (helps debugging)
4849
"/GZ" # Helps Catch Release-Build Errors in Debug Build
49-
"/Yd" # Store complete debug info in .obj (needed for embedded debug info from precompiled header to be accessible)
50+
# "/Yd" # Store complete debug info in .obj (needed for embedded debug info from precompiled header to be accessible)
5051
)
5152
set(CMAKE_CXX_FLAGS_DEBUG "${VC6_CXX_FLAGS_DEBUG}" CACHE STRING "" FORCE)
5253

@@ -69,21 +70,32 @@ set(CMAKE_EXE_LINKER_FLAGS "${VC6_EXE_LINKER_FLAGS}" CACHE STRING "" FORCE)
6970

7071
string(JOIN " " VC6_EXE_LINKER_FLAGS_RELEASE
7172
"/RELEASE" # Set the checksum in the header and mark as release
72-
"/DEBUG:NONE" # Do not generate debug info
73+
# "/DEBUG:NONE" # Do not generate debug info
74+
"/PDBTYPE:SEPT" # Separate debug symbols
75+
"/DEBUGTYPE:BOTH" # Use both CodeView and coff format for debug info
7376
"/OPT:REF,ICF" # Remove unreferenced code/data, COMDAT folding
7477
"/NOLOGO" # Suppress linker startup banner
7578
)
7679
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${VC6_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "" FORCE)
7780

7881
string(JOIN " " VC6_EXE_LINKER_FLAGS_DEBUG
79-
#"/DEBUG" # Generate debug info
80-
#"/PDB:NONE" # Do not generate a PDB file
81-
"/DEBUGTYPE:CV" # Use CodeView format for debug info (VC6 default)
82+
"/DEBUG" # Generate debug info
83+
"/DEBUGTYPE:CV" # Use CodeView format for debug info (VC6 default, needed for incremental linking)
84+
# "/PDB:NONE" # Do not generate a PDB file
85+
"/PDBTYPE:CON" # Place the debug type information in a single .PDB file
8286
"/OPT:NOREF,NOICF" # Do not remove unreferenced code/data, COMDAT folding
83-
"/PDBTYPE:SEPT" # Separate debug symbols (one .pdb per .obj, easier for incremental linking)
8487
"/INCREMENTAL:YES" # Enable incremental linking
8588
"/VERBOSE" # Enable verbose output from the linker
8689
)
8790
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${VC6_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING "" FORCE)
8891

89-
# @todo: Set default flags for C
92+
93+
set(CMAKE_SHARED_LINKER_FLAGS "${VC6_EXE_LINKER_FLAGS}" CACHE STRING "" FORCE)
94+
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${VC6_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING "" FORCE)
95+
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${VC6_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "" FORCE)
96+
97+
set(CMAKE_STATIC_LINKER_FLAGS "/machine:IX86" CACHE STRING "" FORCE)
98+
set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "" CACHE STRING "" FORCE)
99+
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "" CACHE STRING "" FORCE)
100+
101+
# @todo: Set default flags for C

0 commit comments

Comments
 (0)