Skip to content

Commit fef5251

Browse files
authored
build(debug): Add CMake option to generate full debug information for VC6 builds (#1370)
RTS_BUILD_OPTION_VC6_FULL_DEBUG
1 parent ea6a868 commit fef5251

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

cmake/compilers.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ if (NOT IS_VS6_BUILD)
4040
add_compile_options(/Zc:__cplusplus)
4141
endif()
4242
else()
43-
# Define two pools: 'compile' with plenty of slots, 'link' with just one
44-
set_property(GLOBAL PROPERTY JOB_POOLS compile=0 link=1)
43+
if(RTS_BUILD_OPTION_VC6_FULL_DEBUG)
44+
set_property(GLOBAL PROPERTY JOB_POOLS compile=1 link=1)
45+
else()
46+
# Define two pools: 'compile' with plenty of slots, 'link' with just one
47+
set_property(GLOBAL PROPERTY JOB_POOLS compile=0 link=1)
48+
endif()
49+
4550
# Tell CMake that all compile steps go into 'compile'
4651
set(CMAKE_JOB_POOL_COMPILE compile)
4752
# and all link steps go into 'link' (so only one link ever runs since vc6 can't handle multithreaded linking)

cmake/config-build.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ option(RTS_BUILD_GENERALS "Build Generals code." ON)
66
option(RTS_BUILD_OPTION_PROFILE "Build code with the \"Profile\" configuration." OFF)
77
option(RTS_BUILD_OPTION_DEBUG "Build code with the \"Debug\" configuration." OFF)
88
option(RTS_BUILD_OPTION_ASAN "Build code with Address Sanitizer." OFF)
9+
option(RTS_BUILD_OPTION_VC6_FULL_DEBUG "Build VC6 with full debug info." OFF)
910
option(RTS_BUILD_OPTION_FFMPEG "Enable FFmpeg support" OFF)
1011

1112
if(NOT RTS_BUILD_ZEROHOUR AND NOT RTS_BUILD_GENERALS)
@@ -20,6 +21,7 @@ add_feature_info(GeneralsStuff RTS_BUILD_GENERALS "Build Generals code")
2021
add_feature_info(ProfileBuild RTS_BUILD_OPTION_PROFILE "Building as a \"Profile\" build")
2122
add_feature_info(DebugBuild RTS_BUILD_OPTION_DEBUG "Building as a \"Debug\" build")
2223
add_feature_info(AddressSanitizer RTS_BUILD_OPTION_ASAN "Building with address sanitizer")
24+
add_feature_info(Vc6FullDebug RTS_BUILD_OPTION_VC6_FULL_DEBUG "Building VC6 with full debug info")
2325
add_feature_info(FFmpegSupport RTS_BUILD_OPTION_FFMPEG "Building with FFmpeg support")
2426

2527
if(RTS_BUILD_ZEROHOUR)
@@ -47,7 +49,11 @@ if(NOT IS_VS6_BUILD)
4749
target_compile_features(core_config INTERFACE cxx_std_20)
4850
endif()
4951

50-
target_compile_options(core_config INTERFACE ${RTS_FLAGS})
52+
if(IS_VS6_BUILD AND RTS_BUILD_OPTION_VC6_FULL_DEBUG)
53+
target_compile_options(core_config INTERFACE ${RTS_FLAGS} /Zi)
54+
else()
55+
target_compile_options(core_config INTERFACE ${RTS_FLAGS})
56+
endif()
5157

5258
# This disables a lot of warnings steering developers to use windows only functions/function names.
5359
if(MSVC)

0 commit comments

Comments
 (0)