Skip to content

Commit 5cbe8d2

Browse files
authored
Merge pull request #33 from mewpull/fix-build
fix build on Linux
2 parents 49e8453 + 888caed commit 5cbe8d2

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ if(BUILD_GAME)
6565
set_target_properties(game PROPERTIES LINKER_LANGUAGE CXX)
6666
find_package(SDL2 REQUIRED)
6767
include_directories(${SDL2_INCLUDE_DIRS})
68-
target_link_libraries(game ${SDL2_LIBRARIES} SDL2_net SDL2_mixer m dl)
68+
target_link_libraries(game ${SDL2_LIBRARIES} SDL2 SDL2_net SDL2_mixer m dl)
6969
endif()
70-
70+
7171
target_compile_definitions(game PUBLIC D2EXE)
7272
endif()
7373

7474
# Build D2Common.dll
75-
if(BUILD_D2CLIENT OR BUILD_D2GAME)
75+
if(BUILD_D2CLIENT OR BUILD_D2SERVER)
7676
message("Including D2Common.dll files")
7777

7878
file(GLOB_RECURSE D2COMMON_SRC Common/*.h Common/*hpp Common/*.c Common/*.cpp)
@@ -107,12 +107,12 @@ if(BUILD_D2CLIENT)
107107
set_target_properties(D2Client PROPERTIES OUTPUT_NAME D2Client)
108108
set_target_properties(D2Client PROPERTIES LINKER_LANGUAGE CXX)
109109

110-
target_link_libraries(D2Client ${STATIC_LIBRARIES})
110+
target_link_libraries(D2Client ${STATIC_LIBRARIES} D2Common)
111111
target_compile_definitions(D2Client PUBLIC D2CLIENT)
112112
endif()
113113

114114

115-
# Build D2Game.dll
115+
# Build D2Server.dll
116116
if(BUILD_D2SERVER)
117117
message("Including D2Server.dll files")
118118

@@ -127,6 +127,6 @@ if(BUILD_D2SERVER)
127127
set_target_properties(D2Server PROPERTIES OUTPUT_NAME D2Server)
128128
set_target_properties(D2Server PROPERTIES LINKER_LANGUAGE CXX)
129129

130-
target_link_libraries(D2Server ${STATIC_LIBRARIES})
130+
target_link_libraries(D2Server ${STATIC_LIBRARIES} D2Common)
131131
target_compile_definitions(D2Server PUBLIC D2SERVER)
132132
endif()

Game/Platform_Linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ namespace Sys
218218
}
219219
else if (nModule == MODULE_SERVER)
220220
{
221-
bModuleFound = FS::Find("liD2Game.so", szModulePath, MAX_D2PATH_ABSOLUTE);
221+
bModuleFound = FS::Find("libD2Server.so", szModulePath, MAX_D2PATH_ABSOLUTE);
222222
}
223223
Log_ErrorAssertReturn(bModuleFound, nullptr);
224224

@@ -251,4 +251,4 @@ namespace Sys
251251
int main(int argc, char* argv[])
252252
{
253253
return InitGame(argc, argv);
254-
}
254+
}

Game/Platform_Windows.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ namespace Sys
300300
}
301301
else if (nModule == MODULE_SERVER)
302302
{
303-
bModuleFound = FS::Find("D2Game.dll", szModulePath, MAX_D2PATH_ABSOLUTE);
303+
bModuleFound = FS::Find("D2Server.dll", szModulePath, MAX_D2PATH_ABSOLUTE);
304304
}
305305
Log_ErrorAssertReturn(bModuleFound, nullptr);
306306

@@ -339,4 +339,4 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char* szCmdLine
339339
Sys::CopyBetaRegistryKeys();
340340

341341
return InitGame(__argc, __argv);
342-
}
342+
}

0 commit comments

Comments
 (0)