This commit is contained in:
jadebenn 2024-03-07 22:52:11 -06:00
parent 642c86a449
commit ac6c68ecff
15 changed files with 22 additions and 13 deletions

View File

@ -287,7 +287,7 @@ add_subdirectory(dPhysics)
add_subdirectory(dServer) add_subdirectory(dServer)
# Create a list of common libraries shared between all binaries # 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 # Add platform specific common libraries
if(UNIX) if(UNIX)

View File

@ -1,6 +1,6 @@
add_executable(AuthServer "AuthServer.cpp") 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) target_include_directories(AuthServer PRIVATE ${PROJECT_SOURCE_DIR}/dServer)

View File

@ -11,6 +11,6 @@ add_compile_definitions(ChatServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}
add_library(dChatServer ${DCHATSERVER_SOURCES}) add_library(dChatServer ${DCHATSERVER_SOURCES})
target_include_directories(dChatServer PRIVATE "${PROJECT_SOURCE_DIR}/dServer") target_include_directories(dChatServer PRIVATE "${PROJECT_SOURCE_DIR}/dServer")
target_link_libraries(dChatServer ${COMMON_LIBRARIES} dChatFilter) target_link_libraries(dChatServer PRIVATE ${COMMON_LIBRARIES} dChatFilter)
target_link_libraries(ChatServer ${COMMON_LIBRARIES} dChatFilter dChatServer dServer) target_link_libraries(ChatServer PRIVATE ${COMMON_LIBRARIES} dChatFilter dChatServer dServer)

View File

@ -70,5 +70,6 @@ else ()
endif () endif ()
target_link_libraries(dCommon target_link_libraries(dCommon
PUBLIC fmt
PRIVATE ZLIB::ZLIB bcrypt tinyxml2 PRIVATE ZLIB::ZLIB bcrypt tinyxml2
INTERFACE dDatabase) INTERFACE dDatabase)

View File

@ -15,7 +15,7 @@ target_include_directories(dDatabaseCDClient PUBLIC "."
"${PROJECT_SOURCE_DIR}/dCommon" "${PROJECT_SOURCE_DIR}/dCommon"
"${PROJECT_SOURCE_DIR}/dCommon/dEnums" "${PROJECT_SOURCE_DIR}/dCommon/dEnums"
) )
target_link_libraries(dDatabaseCDClient PRIVATE sqlite3) target_link_libraries(dDatabaseCDClient PRIVATE fmt sqlite3)
if (${CDCLIENT_CACHE_ALL}) if (${CDCLIENT_CACHE_ALL})
add_compile_definitions(dDatabaseCDClient PRIVATE CDCLIENT_CACHE_ALL=${CDCLIENT_CACHE_ALL}) add_compile_definitions(dDatabaseCDClient PRIVATE CDCLIENT_CACHE_ALL=${CDCLIENT_CACHE_ALL})

View File

@ -4,4 +4,5 @@ add_subdirectory(GameDatabase)
add_library(dDatabase STATIC "MigrationRunner.cpp") add_library(dDatabase STATIC "MigrationRunner.cpp")
target_include_directories(dDatabase PUBLIC ".") target_include_directories(dDatabase PUBLIC ".")
target_link_libraries(dDatabase target_link_libraries(dDatabase
PUBLIC dDatabaseCDClient dDatabaseGame) PUBLIC dDatabaseCDClient dDatabaseGame
PRIVATE fmt)

View File

@ -16,6 +16,7 @@ target_include_directories(dDatabaseGame PUBLIC "."
) )
target_link_libraries(dDatabaseGame target_link_libraries(dDatabaseGame
PUBLIC MariaDB::ConnCpp PUBLIC MariaDB::ConnCpp
PRIVATE fmt
INTERFACE dCommon) INTERFACE dCommon)
# Glob together all headers that need to be precompiled # Glob together all headers that need to be precompiled

View File

@ -12,8 +12,8 @@ target_include_directories(dMasterServer PUBLIC "."
${PROJECT_SOURCE_DIR}/dServer/ # BinaryPathFinder.h ${PROJECT_SOURCE_DIR}/dServer/ # BinaryPathFinder.h
) )
target_link_libraries(dMasterServer ${COMMON_LIBRARIES}) target_link_libraries(dMasterServer PRIVATE ${COMMON_LIBRARIES})
target_link_libraries(MasterServer ${COMMON_LIBRARIES} bcrypt dMasterServer dServer) target_link_libraries(MasterServer PRIVATE ${COMMON_LIBRARIES} bcrypt dMasterServer dServer)
if(WIN32) if(WIN32)
add_dependencies(MasterServer WorldServer AuthServer ChatServer) add_dependencies(MasterServer WorldServer AuthServer ChatServer)

View File

@ -8,7 +8,7 @@ set(DNET_SOURCES "AuthPackets.cpp"
"ZoneInstanceManager.cpp") "ZoneInstanceManager.cpp")
add_library(dNet STATIC ${DNET_SOURCES}) 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 target_include_directories(dNet PRIVATE
"${PROJECT_SOURCE_DIR}/dCommon" "${PROJECT_SOURCE_DIR}/dCommon"
"${PROJECT_SOURCE_DIR}/dCommon/dEnums" "${PROJECT_SOURCE_DIR}/dCommon/dEnums"

View File

@ -12,5 +12,5 @@ target_include_directories(dPhysics PUBLIC "."
"${PROJECT_SOURCE_DIR}/dCommon/dEnums" "${PROJECT_SOURCE_DIR}/dCommon/dEnums"
) )
target_link_libraries(dPhysics target_link_libraries(dPhysics
PUBLIC Recast Detour PUBLIC fmt Recast Detour
INTERFACE dNavigation dCommon) INTERFACE dNavigation dCommon)

View File

@ -3,6 +3,8 @@ set(DSERVER_SOURCES
add_library(dServer STATIC ${DSERVER_SOURCES}) add_library(dServer STATIC ${DSERVER_SOURCES})
target_link_libraries(dServer PRIVATE fmt)
target_include_directories(dServer PUBLIC ".") target_include_directories(dServer PUBLIC ".")
target_include_directories(dServer PRIVATE target_include_directories(dServer PRIVATE

View File

@ -13,7 +13,7 @@ target_include_directories(WorldServer PRIVATE
"${PROJECT_SOURCE_DIR}/dServer" # BinaryPathFinder.h "${PROJECT_SOURCE_DIR}/dServer" # BinaryPathFinder.h
) )
target_link_libraries(WorldServer ${COMMON_LIBRARIES} target_link_libraries(WorldServer PRIVATE ${COMMON_LIBRARIES}
dScripts dScripts
dGameBase dGameBase
dComponents dComponents

View File

@ -1,6 +1,7 @@
set(DCOMMONTEST_SOURCES set(DCOMMONTEST_SOURCES
"AMFDeserializeTests.cpp" "AMFDeserializeTests.cpp"
"Amf3Tests.cpp" "Amf3Tests.cpp"
"LoggerTests.cpp"
"ToUnderlyingTests.cpp" "ToUnderlyingTests.cpp"
"HeaderSkipTest.cpp" "HeaderSkipTest.cpp"
"TestCDFeatureGatingTable.cpp" "TestCDFeatureGatingTable.cpp"
@ -32,7 +33,7 @@ add_custom_command(TARGET dCommonTests POST_BUILD
endif() endif()
# Link needed libraries # 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 # Copy test files to testing directory
add_subdirectory(TestBitStreams) add_subdirectory(TestBitStreams)

View File

@ -22,7 +22,7 @@ add_custom_command(TARGET dGameTests POST_BUILD
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif() 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) dGame dScripts dPhysics Detour Recast tinyxml2 dWorldServer dZoneManager dChatFilter dNavigation)
# Discover the tests # Discover the tests

View File

@ -1,6 +1,9 @@
# Source Code for recast # Source Code for recast
add_subdirectory(recastnavigation) add_subdirectory(recastnavigation)
# Add fmtlib
add_subdirectory(fmt SYSTEM)
# Turn off tinyxml2 testing # Turn off tinyxml2 testing
set(tinyxml2_BUILD_TESTING OFF) set(tinyxml2_BUILD_TESTING OFF)
# Source Code for tinyxml2 # Source Code for tinyxml2