Skip to content

Commit 4e09f37

Browse files
OmniBladePiecePaperCode
authored andcommitted
[GEN][ZH] Remove "pragma comment" implict linker instructions. (TheSuperHackers#498)
Cleans up sub library naming as libraries are now named based on target name and don't vary based on build options.
1 parent 0e0d8df commit 4e09f37

File tree

22 files changed

+4
-82
lines changed

22 files changed

+4
-82
lines changed

Generals/Code/GameEngine/CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -1059,10 +1059,6 @@ set(GAMEENGINE_SRC
10591059

10601060
add_library(g_gameengine STATIC)
10611061

1062-
set_target_properties(g_gameengine PROPERTIES OUTPUT_NAME
1063-
$<IF:$<CONFIG:Debug>,gameenginedebug,$<IF:$<BOOL:${GENZH_BUILD_INTERNAL}>,gameengineinternal,gameengine>>
1064-
)
1065-
10661062
target_sources(g_gameengine PRIVATE ${GAMEENGINE_SRC})
10671063

10681064
target_include_directories(g_gameengine PUBLIC

Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -3242,23 +3242,6 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en
32423242
// GLOBAL FUNCTIONS
32433243
//-----------------------------------------------------------------------------
32443244

3245-
/*
3246-
This is a trick that is intended to force MSVC to link this file (and thus,
3247-
these definitions of new/delete) ahead of all others. (We do debug checking
3248-
to ensure that's the case)
3249-
*/
3250-
#if defined(_DEBUG)
3251-
#pragma comment(lib, "GameEngineDebug")
3252-
#elif defined(_INTERNAL)
3253-
#pragma comment(lib, "GameEngineInternal")
3254-
#else
3255-
#pragma comment(lib, "GameEngine")
3256-
#endif
3257-
3258-
#ifdef MEMORYPOOL_OVERRIDE_MALLOC
3259-
#pragma comment(linker, "/force:multiple")
3260-
#endif
3261-
32623245
static int theLinkTester = 0;
32633246

32643247
//-----------------------------------------------------------------------------

Generals/Code/GameEngine/Source/Common/System/StackDump.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828

2929
#pragma pack(push, 8)
3030

31-
#pragma comment(linker, "/defaultlib:Dbghelp.lib")
32-
3331
#include "Common/StackDump.h"
3432
#include "Common/Debug.h"
3533

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DGranny.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454
#include "WW3D2/dx8wrapper.h"
5555
#include "WW3D2/scene.h"
5656

57-
#pragma comment( lib, "granny2" )
58-
5957
static granny_pnt332_vertex g_blendingBuffer[4096]; ///<temporary workspace for granny (all models < 4096 verts).
6058

6159
/** Local function used to find animation matching the given model */

Generals/Code/Main/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ endif()
99

1010
target_link_libraries(g_generals PRIVATE
1111
binkstub
12+
comctl32
1213
d3d8
1314
d3dx8
1415
dbghelplib

Generals/Code/Tools/MapCacheBuilder/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ target_include_directories(g_mapcachebuilder PRIVATE
1515
)
1616
#
1717
target_link_libraries(g_mapcachebuilder PRIVATE
18+
comctl32
1819
dbghelplib
1920
g_gameengine
2021
g_gameenginedevice

GeneralsMD/Code/GameEngine/CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -1142,10 +1142,6 @@ set(GAMEENGINE_SRC
11421142

11431143
add_library(z_gameengine STATIC)
11441144

1145-
set_target_properties(z_gameengine PROPERTIES OUTPUT_NAME
1146-
$<IF:$<CONFIG:Debug>,gameenginedebug,$<IF:$<BOOL:${GENZH_BUILD_INTERNAL}>,gameengineinternal,gameengine>>
1147-
)
1148-
11491145
target_sources(z_gameengine PRIVATE ${GAMEENGINE_SRC})
11501146

11511147
target_include_directories(z_gameengine PUBLIC

GeneralsMD/Code/GameEngine/Source/Common/System/GameMemory.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -3230,23 +3230,6 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en
32303230
// GLOBAL FUNCTIONS
32313231
//-----------------------------------------------------------------------------
32323232

3233-
/*
3234-
This is a trick that is intended to force MSVC to link this file (and thus,
3235-
these definitions of new/delete) ahead of all others. (We do debug checking
3236-
to ensure that's the case)
3237-
*/
3238-
#if defined(_DEBUG)
3239-
#pragma comment(lib, "GameEngineDebug")
3240-
#elif defined(_INTERNAL)
3241-
#pragma comment(lib, "GameEngineInternal")
3242-
#else
3243-
#pragma comment(lib, "GameEngine")
3244-
#endif
3245-
3246-
#ifdef MEMORYPOOL_OVERRIDE_MALLOC
3247-
#pragma comment(linker, "/force:multiple")
3248-
#endif
3249-
32503233
static int theLinkTester = 0;
32513234

32523235
//-----------------------------------------------------------------------------

GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828

2929
#pragma pack(push, 8)
3030

31-
#pragma comment(linker, "/defaultlib:Dbghelp.lib")
32-
3331
#include "Common/StackDump.h"
3432
#include "Common/Debug.h"
3533

GeneralsMD/Code/GameEngineDevice/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ set(GAMEENGINEDEVICE_SRC
197197
)
198198

199199
add_library(z_gameenginedevice STATIC)
200-
set_target_properties(z_gameenginedevice PROPERTIES OUTPUT_NAME gameenginedevice)
201200

202201
target_sources(z_gameenginedevice PRIVATE ${GAMEENGINEDEVICE_SRC})
203202

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DGranny.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454
#include "WW3D2/dx8wrapper.h"
5555
#include "WW3D2/scene.h"
5656

57-
#pragma comment( lib, "granny2" )
58-
5957
static granny_pnt332_vertex g_blendingBuffer[4096]; ///<temporary workspace for granny (all models < 4096 verts).
6058

6159
/** Local function used to find animation matching the given model */

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

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ set(DEBUG_SRC
2525
)
2626

2727
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>>>)
3028

3129
target_sources(z_debug PRIVATE ${DEBUG_SRC})
3230

GeneralsMD/Code/Libraries/Source/debug/debug.h

-4
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,18 @@
9090

9191
// Define which libraries to use.
9292
#if defined(_INTERNAL)
93-
# pragma comment (lib,"debuginternal.lib")
9493
# define HAS_ASSERTS
9594
# define HAS_LOGS
9695
# define HAS_OPT
9796
#elif defined(_DEBUG)
98-
# pragma comment (lib,"debugdebug.lib")
9997
# define HAS_ASSERTS
10098
# define HAS_LOGS
10199
#elif defined(_PROFILE)
102-
# pragma comment (lib,"debugprofile.lib")
103100
# define HAS_ASSERTS
104101
# define HAS_LOGS
105102
# define HAS_OPT
106103
# define HAS_PROFILE
107104
#else
108-
# pragma comment (lib,"debug.lib")
109105
# define HAS_OPT
110106
#endif
111107

GeneralsMD/Code/Libraries/Source/debug/debug_debug.h

-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
#ifndef DEBUG_DEBUG_H // Include guard
3333
#define DEBUG_DEBUG_H
3434

35-
// this makes sure that whenever this header is included
36-
// the accompanying OBJ file is linked in as well
37-
#pragma comment(linker,"/include:___DebugIncludeInLink1")
38-
3935
/**
4036
\class Debug debug.h <rts/debug.h>
4137

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

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434

3535
// Pardon my coding here but this is for testing only...
3636

37-
#pragma comment (lib,"comctl32")
38-
3937
BOOL CALLBACK DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
4038
{
4139
switch(uMsg)

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

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
#include "_pch.h"
3030
#include <commctrl.h>
3131

32-
#pragma comment (lib,"comctl32")
33-
3432
DebugExceptionhandler::DebugExceptionhandler(void)
3533
{
3634
// don't do anything here!

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

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
// Debug module - Test 3 (Checking FLAT I/O, logging)
2828
//////////////////////////////////////////////////////////////////////////////
2929
#ifdef NDEBUG
30-
# define _INTERNAL
31-
# pragma comment(linker,"/nodefaultlib:debuginternal.lib")
32-
#endif
3330
#include "../debug.h"
3431

3532
unsigned divByNull;

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

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ set(PROFILE_SRC
1919
)
2020

2121
add_library(z_profile STATIC)
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>>>)
2322

2423
target_sources(z_profile PRIVATE ${PROFILE_SRC})
2524

GeneralsMD/Code/Libraries/Source/profile/profile.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
#include <new>
3131
#include "mmsystem.h"
3232

33-
#pragma comment (lib,"winmm")
34-
3533
// yuk, I'm doing this so weird because the destructor
3634
// of cmd must never be called...
3735
static ProfileCmdInterface &cmd=*(ProfileCmdInterface *)new

GeneralsMD/Code/Libraries/Source/profile/profile.h

-11
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@
3636
#error "Only either _DEBUG or _INTERNAL should ever be defined"
3737
#endif
3838

39-
// Define which libraries to use.
40-
#if defined(_INTERNAL)
41-
# pragma comment (lib,"profileinternal.lib")
42-
#elif defined(_DEBUG)
43-
# pragma comment (lib,"profiledebug.lib")
44-
#elif defined(_PROFILE)
45-
# pragma comment (lib,"profileprofile.lib")
46-
#else
47-
# pragma comment (lib,"profile.lib")
48-
#endif
49-
5039
// include all our public header files (use double quotes here)
5140
#include "profile_doc.h"
5241
#include "profile_highlevel.h"

GeneralsMD/Code/Main/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ endif()
99

1010
target_link_libraries(z_generals PRIVATE
1111
binkstub
12+
comctl32
1213
d3d8
1314
d3dx8
1415
dbghelplib

GeneralsMD/Code/Tools/MapCacheBuilder/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ target_include_directories(z_mapcachebuilder PRIVATE
1515
)
1616
#
1717
target_link_libraries(z_mapcachebuilder PRIVATE
18+
comctl32
1819
dbghelplib
1920
imm32
2021
vfw32

0 commit comments

Comments
 (0)