mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 13:37:22 +00:00
cmake
This commit is contained in:
parent
642c86a449
commit
ac6c68ecff
@ -287,7 +287,7 @@ add_subdirectory(dPhysics)
|
||||
add_subdirectory(dServer)
|
||||
|
||||
# Create a list of common libraries shared between all binaries
|
||||
set(COMMON_LIBRARIES "dCommon" "dDatabase" "dNet" "raknet" "MariaDB::ConnCpp" "magic_enum")
|
||||
set(COMMON_LIBRARIES "dCommon" "dDatabase" "dNet" "fmt" "raknet" "MariaDB::ConnCpp" "magic_enum")
|
||||
|
||||
# Add platform specific common libraries
|
||||
if(UNIX)
|
||||
|
@ -1,6 +1,6 @@
|
||||
add_executable(AuthServer "AuthServer.cpp")
|
||||
|
||||
target_link_libraries(AuthServer ${COMMON_LIBRARIES} dServer)
|
||||
target_link_libraries(AuthServer PRIVATE ${COMMON_LIBRARIES} dServer)
|
||||
|
||||
target_include_directories(AuthServer PRIVATE ${PROJECT_SOURCE_DIR}/dServer)
|
||||
|
||||
|
@ -11,6 +11,6 @@ add_compile_definitions(ChatServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}
|
||||
add_library(dChatServer ${DCHATSERVER_SOURCES})
|
||||
target_include_directories(dChatServer PRIVATE "${PROJECT_SOURCE_DIR}/dServer")
|
||||
|
||||
target_link_libraries(dChatServer ${COMMON_LIBRARIES} dChatFilter)
|
||||
target_link_libraries(ChatServer ${COMMON_LIBRARIES} dChatFilter dChatServer dServer)
|
||||
target_link_libraries(dChatServer PRIVATE ${COMMON_LIBRARIES} dChatFilter)
|
||||
target_link_libraries(ChatServer PRIVATE ${COMMON_LIBRARIES} dChatFilter dChatServer dServer)
|
||||
|
||||
|
@ -70,5 +70,6 @@ else ()
|
||||
endif ()
|
||||
|
||||
target_link_libraries(dCommon
|
||||
PUBLIC fmt
|
||||
PRIVATE ZLIB::ZLIB bcrypt tinyxml2
|
||||
INTERFACE dDatabase)
|
||||
|
@ -15,7 +15,7 @@ target_include_directories(dDatabaseCDClient PUBLIC "."
|
||||
"${PROJECT_SOURCE_DIR}/dCommon"
|
||||
"${PROJECT_SOURCE_DIR}/dCommon/dEnums"
|
||||
)
|
||||
target_link_libraries(dDatabaseCDClient PRIVATE sqlite3)
|
||||
target_link_libraries(dDatabaseCDClient PRIVATE fmt sqlite3)
|
||||
|
||||
if (${CDCLIENT_CACHE_ALL})
|
||||
add_compile_definitions(dDatabaseCDClient PRIVATE CDCLIENT_CACHE_ALL=${CDCLIENT_CACHE_ALL})
|
||||
|
@ -4,4 +4,5 @@ add_subdirectory(GameDatabase)
|
||||
add_library(dDatabase STATIC "MigrationRunner.cpp")
|
||||
target_include_directories(dDatabase PUBLIC ".")
|
||||
target_link_libraries(dDatabase
|
||||
PUBLIC dDatabaseCDClient dDatabaseGame)
|
||||
PUBLIC dDatabaseCDClient dDatabaseGame
|
||||
PRIVATE fmt)
|
||||
|
@ -16,6 +16,7 @@ target_include_directories(dDatabaseGame PUBLIC "."
|
||||
)
|
||||
target_link_libraries(dDatabaseGame
|
||||
PUBLIC MariaDB::ConnCpp
|
||||
PRIVATE fmt
|
||||
INTERFACE dCommon)
|
||||
|
||||
# Glob together all headers that need to be precompiled
|
||||
|
@ -12,8 +12,8 @@ target_include_directories(dMasterServer PUBLIC "."
|
||||
${PROJECT_SOURCE_DIR}/dServer/ # BinaryPathFinder.h
|
||||
)
|
||||
|
||||
target_link_libraries(dMasterServer ${COMMON_LIBRARIES})
|
||||
target_link_libraries(MasterServer ${COMMON_LIBRARIES} bcrypt dMasterServer dServer)
|
||||
target_link_libraries(dMasterServer PRIVATE ${COMMON_LIBRARIES})
|
||||
target_link_libraries(MasterServer PRIVATE ${COMMON_LIBRARIES} bcrypt dMasterServer dServer)
|
||||
|
||||
if(WIN32)
|
||||
add_dependencies(MasterServer WorldServer AuthServer ChatServer)
|
||||
|
@ -8,7 +8,7 @@ set(DNET_SOURCES "AuthPackets.cpp"
|
||||
"ZoneInstanceManager.cpp")
|
||||
|
||||
add_library(dNet STATIC ${DNET_SOURCES})
|
||||
target_link_libraries(dNet PRIVATE bcrypt MD5)
|
||||
target_link_libraries(dNet PRIVATE bcrypt fmt MD5)
|
||||
target_include_directories(dNet PRIVATE
|
||||
"${PROJECT_SOURCE_DIR}/dCommon"
|
||||
"${PROJECT_SOURCE_DIR}/dCommon/dEnums"
|
||||
|
@ -12,5 +12,5 @@ target_include_directories(dPhysics PUBLIC "."
|
||||
"${PROJECT_SOURCE_DIR}/dCommon/dEnums"
|
||||
)
|
||||
target_link_libraries(dPhysics
|
||||
PUBLIC Recast Detour
|
||||
PUBLIC fmt Recast Detour
|
||||
INTERFACE dNavigation dCommon)
|
||||
|
@ -3,6 +3,8 @@ set(DSERVER_SOURCES
|
||||
|
||||
add_library(dServer STATIC ${DSERVER_SOURCES})
|
||||
|
||||
target_link_libraries(dServer PRIVATE fmt)
|
||||
|
||||
target_include_directories(dServer PUBLIC ".")
|
||||
|
||||
target_include_directories(dServer PRIVATE
|
||||
|
@ -13,7 +13,7 @@ target_include_directories(WorldServer PRIVATE
|
||||
"${PROJECT_SOURCE_DIR}/dServer" # BinaryPathFinder.h
|
||||
)
|
||||
|
||||
target_link_libraries(WorldServer ${COMMON_LIBRARIES}
|
||||
target_link_libraries(WorldServer PRIVATE ${COMMON_LIBRARIES}
|
||||
dScripts
|
||||
dGameBase
|
||||
dComponents
|
||||
|
@ -1,6 +1,7 @@
|
||||
set(DCOMMONTEST_SOURCES
|
||||
"AMFDeserializeTests.cpp"
|
||||
"Amf3Tests.cpp"
|
||||
"LoggerTests.cpp"
|
||||
"ToUnderlyingTests.cpp"
|
||||
"HeaderSkipTest.cpp"
|
||||
"TestCDFeatureGatingTable.cpp"
|
||||
@ -32,7 +33,7 @@ add_custom_command(TARGET dCommonTests POST_BUILD
|
||||
endif()
|
||||
|
||||
# Link needed libraries
|
||||
target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main)
|
||||
target_link_libraries(dCommonTests PRIVATE ${COMMON_LIBRARIES} GTest::gtest_main)
|
||||
|
||||
# Copy test files to testing directory
|
||||
add_subdirectory(TestBitStreams)
|
||||
|
@ -22,7 +22,7 @@ add_custom_command(TARGET dGameTests POST_BUILD
|
||||
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
endif()
|
||||
|
||||
target_link_libraries(dGameTests ${COMMON_LIBRARIES} GTest::gtest_main
|
||||
target_link_libraries(dGameTests PRIVATE ${COMMON_LIBRARIES} GTest::gtest_main
|
||||
dGame dScripts dPhysics Detour Recast tinyxml2 dWorldServer dZoneManager dChatFilter dNavigation)
|
||||
|
||||
# Discover the tests
|
||||
|
3
thirdparty/CMakeLists.txt
vendored
3
thirdparty/CMakeLists.txt
vendored
@ -1,6 +1,9 @@
|
||||
# Source Code for recast
|
||||
add_subdirectory(recastnavigation)
|
||||
|
||||
# Add fmtlib
|
||||
add_subdirectory(fmt SYSTEM)
|
||||
|
||||
# Turn off tinyxml2 testing
|
||||
set(tinyxml2_BUILD_TESTING OFF)
|
||||
# Source Code for tinyxml2
|
||||
|
Loading…
Reference in New Issue
Block a user