Skip to content

Commit 114f16a

Browse files
authored
Fix building debug and internal builds. (#452)
1 parent 058d2da commit 114f16a

File tree

13 files changed

+60
-26
lines changed

13 files changed

+60
-26
lines changed

Generals/Code/GameEngine/CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,13 +1059,9 @@ set(GAMEENGINE_SRC
10591059

10601060
add_library(g_gameengine STATIC)
10611061

1062-
if(GENZH_BUILD_DEBUG)
1063-
set_target_properties(g_gameengine PROPERTIES OUTPUT_NAME gameenginedebug)
1064-
elseif(GENZH_BUILD_INTERNAL)
1065-
set_target_properties(g_gameengine PROPERTIES OUTPUT_NAME gameengineinternal)
1066-
else()
1067-
set_target_properties(g_gameengine PROPERTIES OUTPUT_NAME gameengine)
1068-
endif()
1062+
set_target_properties(g_gameengine PROPERTIES OUTPUT_NAME
1063+
$<IF:$<CONFIG:Debug>,gameenginedebug,$<IF:$<BOOL:${GENZH_BUILD_INTERNAL}>,gameengineinternal,gameengine>>
1064+
)
10691065

10701066
target_sources(g_gameengine PRIVATE ${GAMEENGINE_SRC})
10711067

GeneralsMD/Code/GameEngine/CMakeLists.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,15 +1141,10 @@ set(GAMEENGINE_SRC
11411141
)
11421142

11431143
add_library(z_gameengine STATIC)
1144-
set_target_properties(z_gameengine PROPERTIES OUTPUT_NAME $<IF:$<CONFIG:Debug>,gameenginedebug,gameengine>)
11451144

1146-
if(GENZH_BUILD_DEBUG)
1147-
set_target_properties(z_gameengine PROPERTIES OUTPUT_NAME gameenginedebug)
1148-
elseif(GENZH_BUILD_INTERNAL)
1149-
set_target_properties(z_gameengine PROPERTIES OUTPUT_NAME gameengineinternal)
1150-
else()
1151-
set_target_properties(z_gameengine PROPERTIES OUTPUT_NAME gameengine)
1152-
endif()
1145+
set_target_properties(z_gameengine PROPERTIES OUTPUT_NAME
1146+
$<IF:$<CONFIG:Debug>,gameenginedebug,$<IF:$<BOOL:${GENZH_BUILD_INTERNAL}>,gameengineinternal,gameengine>>
1147+
)
11531148

11541149
target_sources(z_gameengine PRIVATE ${GAMEENGINE_SRC})
11551150

GeneralsMD/Code/Libraries/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ add_subdirectory(Source/WWVegas)
44
# profiling library
55
add_subdirectory(Source/profile)
66

7+
# debugging library
8+
add_subdirectory(Source/debug)
9+
710
add_subdirectory(Source/EABrowserDispatch)
811
add_subdirectory(Source/Compression)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
set(DEBUG_SRC
2+
"_pch.cpp"
3+
"_pch.h"
4+
"debug_io.h"
5+
"debug_io_con.cpp"
6+
"debug_io_flat.cpp"
7+
"debug_io_net.cpp"
8+
"debug_io_ods.cpp"
9+
"internal_io.h"
10+
"debug_except.cpp"
11+
"internal_except.h"
12+
"debug_stack.cpp"
13+
"debug_stack.h"
14+
"debug_cmd.cpp"
15+
"debug_cmd.h"
16+
"debug_getdefaultcommands.cpp"
17+
"debug.cpp"
18+
"debug.h"
19+
"debug_debug.cpp"
20+
"debug_debug.h"
21+
"debug_doc.h"
22+
"debug_internal.cpp"
23+
"debug_macro.h"
24+
"internal.h"
25+
)
26+
27+
add_library(z_debug STATIC)
28+
# pragma comment statements force linking certain libraries require this monster of a generator statement.
29+
set_target_properties(z_debug PROPERTIES OUTPUT_NAME $<IF:$<CONFIG:Debug>,debugdebug,$<IF:$<BOOL:${GENZH_BUILD_INTERNAL}>,debuginternal,$<IF:$<BOOL:${GENZH_BUILD_PROFILE}>,debugprofile,debug>>>)
30+
31+
target_sources(z_debug PRIVATE ${DEBUG_SRC})
32+
33+
target_include_directories(z_debug INTERFACE
34+
.
35+
)
36+
37+
target_link_libraries(z_debug PRIVATE
38+
gz_config
39+
zi_libraries_include
40+
)

GeneralsMD/Code/Libraries/Source/debug/debug_stack.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
// $Revision: #2 $
2323
// $DateTime: 2005/01/19 15:02:33 $
2424
//
25-
// ©2003 Electronic Arts
25+
// 2003 Electronic Arts
2626
//
2727
// Stack walker
2828
//////////////////////////////////////////////////////////////////////////////
2929
#include "_pch.h"
30-
#include "dbghelp.h"
30+
#include <imagehlp.h>
3131

3232
// Definitions to allow run-time linking to the dbghelp.dll functions.
3333

GeneralsMD/Code/Libraries/Source/profile/CMakeLists.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set(PROFILE_SRC
1919
)
2020

2121
add_library(z_profile STATIC)
22-
set_target_properties(z_profile PROPERTIES OUTPUT_NAME profile)
22+
set_target_properties(z_profile PROPERTIES OUTPUT_NAME $<IF:$<CONFIG:Debug>,profiledebug,$<IF:$<BOOL:${GENZH_BUILD_INTERNAL}>,profileinternal,$<IF:$<BOOL:${GENZH_BUILD_PROFILE}>,profileprofile,profile>>>)
2323

2424
target_sources(z_profile PRIVATE ${PROFILE_SRC})
2525

@@ -28,13 +28,6 @@ target_include_directories(z_profile INTERFACE
2828
)
2929

3030
target_link_libraries(z_profile PRIVATE
31+
gz_config
3132
zi_libraries_include
3233
)
33-
34-
if(GENZH_BUILD_DEBUG)
35-
set_target_properties(z_profile PROPERTIES OUTPUT_NAME profiledebug)
36-
elseif(GENZH_BUILD_INTERNAL)
37-
set_target_properties(z_profile PROPERTIES OUTPUT_NAME profileinternal)
38-
else()
39-
set_target_properties(z_profile PROPERTIES OUTPUT_NAME profile)
40-
endif()

GeneralsMD/Code/Main/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ target_link_libraries(z_generals PRIVATE
1313
safedisc
1414
vfw32
1515
winmm
16+
z_debug
1617
z_gameengine
1718
z_gameenginedevice
1819
z_profile

GeneralsMD/Code/Tools/GUIEdit/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ target_link_libraries(z_guiedit PRIVATE
5454
stlport
5555
vfw32
5656
winmm
57+
z_debug
5758
z_gameengine
5859
z_gameenginedevice
5960
z_profile

GeneralsMD/Code/Tools/ImagePacker/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ target_link_libraries(z_imagepacker PRIVATE
3333
imm32
3434
vfw32
3535
winmm
36+
z_debug
3637
z_gameengine
3738
z_gameenginedevice
3839
z_profile

GeneralsMD/Code/Tools/MapCacheBuilder/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ target_link_libraries(z_mapcachebuilder PRIVATE
1919
imm32
2020
vfw32
2121
winmm
22+
z_debug
2223
z_gameengine
2324
z_gameenginedevice
2425
z_profile

GeneralsMD/Code/Tools/PATCHGET/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ macro(setup_patchgrabber appname)
2727
imm32
2828
vfw32
2929
winmm
30+
z_debug
3031
z_gameengine
3132
z_gameenginedevice
3233
z_profile

GeneralsMD/Code/Tools/ParticleEditor/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ target_link_libraries(z_particleeditor PRIVATE
4343
stlport
4444
vfw32
4545
winmm
46+
z_debug
4647
z_profile
4748
zi_gameengine_include
4849
zi_libraries_include

GeneralsMD/Code/Tools/WorldBuilder/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ target_link_libraries(z_worldbuilder PRIVATE
216216
vfw32
217217
winmm
218218
z_browserdispatch
219+
z_debug
219220
z_gameengine
220221
z_gameenginedevice
221222
z_profile

0 commit comments

Comments
 (0)