fix: more include changes

This commit is contained in:
Xiphoseer 2024-01-03 21:13:47 +01:00
parent 2804dc3ec2
commit bfe39a919e
15 changed files with 99 additions and 25 deletions

View File

@ -209,17 +209,6 @@ set(INCLUDED_DIRECTORIES
"dChatFilter"
"dGame"
"dGame/dBehaviors"
"dGame/dComponents"
"dGame/dGameMessages"
"dGame/dInventory"
"dGame/dMission"
"dGame/dEntity"
"dGame/dPropertyBehaviors"
"dGame/dPropertyBehaviors/ControlBehaviorMessages"
"dGame/dUtilities"
"dPhysics"
"dNavigation"

View File

@ -15,6 +15,8 @@ include_directories(
add_library(dGameBase ${DGAME_SOURCES})
target_precompile_headers(dGameBase PRIVATE ${HEADERS_DGAME})
target_include_directories(dGameBase PUBLIC "." "dEntity"
PRIVATE "dComponents" "dGameMessages" "dBehaviors" "dMission" "dUtilities" "dInventory")
target_link_libraries(dGameBase
PUBLIC dDatabase dPhysics
INTERFACE dComponents dEntity)

View File

@ -58,5 +58,12 @@ set(DGAME_DBEHAVIORS_SOURCES "AirMovementBehavior.cpp"
add_library(dBehaviors STATIC ${DGAME_DBEHAVIORS_SOURCES})
target_link_libraries(dBehaviors PUBLIC dPhysics)
target_include_directories(dBehaviors PUBLIC ".")
target_include_directories(dBehaviors PUBLIC "."
"${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # via BehaviorContext.h
PRIVATE
"${PROJECT_SOURCE_DIR}/dGame/dComponents" # direct BuffComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dUtilities" # Preconditions.h via QuickBuildComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager.h, Spawner.h
"${PROJECT_SOURCE_DIR}/dGame/dInventory" # via CharacterComponent.h
)
target_precompile_headers(dBehaviors REUSE_FROM dGameBase)

View File

@ -50,7 +50,16 @@ set(DGAME_DCOMPONENTS_SOURCES
)
add_library(dComponents STATIC ${DGAME_DCOMPONENTS_SOURCES})
target_include_directories(dComponents PRIVATE ${PROJECT_SOURCE_DIR}/dScripts/02_server/Map/General) # PetDigServer.h
target_include_directories(dComponents PUBLIC "."
"${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dInventory" # via InventoryComponent.h
PRIVATE
"${PROJECT_SOURCE_DIR}/dScripts/02_server/Map/General" # PetDigServer.h
"${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # direct
"${PROJECT_SOURCE_DIR}/dGame/dUtilities" # direct Loot.h
"${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager/Spawner.h
)
target_precompile_headers(dComponents REUSE_FROM dGameBase)
target_link_libraries(dComponents
PUBLIC dPhysics dDatabase

View File

@ -5,5 +5,18 @@ set(DGAME_DGAMEMESSAGES_SOURCES
"PropertySelectQueryProperty.cpp")
add_library(dGameMessages STATIC ${DGAME_DGAMEMESSAGES_SOURCES})
target_link_libraries(dGameMessages PUBLIC dDatabase)
target_link_libraries(dGameMessages
PUBLIC dDatabase
INTERFACE dGameBase # TradingManager
)
target_include_directories(dGameMessages PUBLIC "."
PRIVATE
"${PROJECT_SOURCE_DIR}/dGame/dComponents" # direct MissionComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dUtilities" # direct SlashCommandHandler.h
"${PROJECT_SOURCE_DIR}/dGame/dPropertyBehaviors" # direct ControlBehaviors.h
"${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dInventory" # via InventoryComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager/Spawner.h
)
target_precompile_headers(dGameMessages REUSE_FROM dGameBase)

View File

@ -6,4 +6,14 @@ set(DGAME_DINVENTORY_SOURCES
"ItemSetPassiveAbility.cpp")
add_library(dInventory STATIC ${DGAME_DINVENTORY_SOURCES})
target_include_directories(dInventory PUBLIC "."
"${PROJECT_SOURCE_DIR}/dGame/dUtilities" # Item.h uses Preconditions.h
PRIVATE
"${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # direct
"${PROJECT_SOURCE_DIR}/dGame/dComponents" # direct InventoryComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager/Spawner.h
"${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h
)
target_link_libraries(dInventory INTERFACE dNet)
target_precompile_headers(dInventory REUSE_FROM dGameBase)

View File

@ -5,4 +5,13 @@ set(DGAME_DMISSION_SOURCES
add_library(dMission STATIC ${DGAME_DMISSION_SOURCES})
target_link_libraries(dMission PUBLIC dDatabase)
target_include_directories(dMission PUBLIC "."
PRIVATE
"${PROJECT_SOURCE_DIR}/dGame/dComponents"
"${PROJECT_SOURCE_DIR}/dGame/dInventory" # via CharacterComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dUtilities" # via CharacterComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # via LevelProgressionComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager/Spawner.h
"${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h
)
target_precompile_headers(dMission REUSE_FROM dGameBase)

View File

@ -13,4 +13,9 @@ foreach(file ${DGAME_DPROPERTYBEHAVIORS_CONTROLBEHAVIORMESSAGES})
endforeach()
add_library(dPropertyBehaviors STATIC ${DGAME_DPROPERTYBEHAVIORS_SOURCES})
target_include_directories(dPropertyBehaviors PUBLIC "." "ControlBehaviorMessages"
PRIVATE
"${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # GameMessages.h
"${PROJECT_SOURCE_DIR}/dGame/dComponents" # ModelComponent.h
)
target_precompile_headers(dPropertyBehaviors REUSE_FROM dGameBase)

View File

@ -10,6 +10,15 @@ set(DGAME_DUTILITIES_SOURCES "BrickDatabase.cpp"
add_library(dUtilities STATIC ${DGAME_DUTILITIES_SOURCES})
target_precompile_headers(dUtilities REUSE_FROM dGameBase)
target_include_directories(dUtilities PUBLIC "."
PRIVATE
"${PROJECT_SOURCE_DIR}/dGame/dComponents"
"${PROJECT_SOURCE_DIR}/dGame/dInventory" # transitive via PossessableComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dGameMessages"
"${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # transitive via InventoryComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dMission" # transitive via MissionComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dEntity" # transitive via dZoneManager/Spawner.h
)
target_link_libraries(dUtilities
PUBLIC dDatabase dPhysics
INTERFACE dZoneManager)

View File

@ -7,4 +7,5 @@ foreach(file ${DNAVIGATIONS_DTERRAIN_SOURCES})
endforeach()
add_library(dNavigation STATIC ${DNAVIGATION_SOURCES})
target_link_libraries(dNavigation Detour Recast)
target_link_libraries(dNavigation
PRIVATE Detour Recast dZoneManager)

View File

@ -9,9 +9,13 @@ set(DNET_SOURCES "AuthPackets.cpp"
add_library(dNet STATIC ${DNET_SOURCES})
target_include_directories(dNet PRIVATE
${PROJECT_SOURCE_DIR}/dGame # UserManager.h
${PROJECT_SOURCE_DIR}/dGame/dComponents
${PROJECT_SOURCE_DIR}/dGame/dGameMessages # GameMessages.h
${PROJECT_SOURCE_DIR}/dGame/dInventory # via PossessableComponent.h
${PROJECT_SOURCE_DIR}/dGame/dUtilities # via Item.h
${PROJECT_SOURCE_DIR}/dScripts # transitive through components
)
target_link_libraries(dNet
PUBLIC dCommon dDatabase
INTERFACE dZoneManager)
PUBLIC dCommon dDatabase
PRIVATE dZoneManager)

View File

@ -19,13 +19,19 @@ link_libraries(dDatabase dPhysics)
add_library(dScriptsBase STATIC ${DSCRIPTS_SOURCES})
target_include_directories(dScriptsBase PUBLIC .)
target_link_libraries(dScriptsBase
INTERFACE dGameBase)
target_link_libraries(dScriptsBase INTERFACE dGameBase)
target_precompile_headers(dScriptsBase PRIVATE ${HEADERS_DGAME})
include_directories(
${PROJECT_SOURCE_DIR}/dScripts
${PROJECT_SOURCE_DIR}/dGame
"${PROJECT_SOURCE_DIR}/dScripts"
"${PROJECT_SOURCE_DIR}/dGame"
"${PROJECT_SOURCE_DIR}/dGame/dComponents" # e.g. ScriptedActivityComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # e.g. direct ActivityManager
"${PROJECT_SOURCE_DIR}/dGame/dUtilities" # e.g. direct ActivityManager
"${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager.h
"${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # viaInventoryComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dInventory" # via InventoryComponent.h
)
link_libraries(dScriptsBase)
# dComponents

View File

@ -3,9 +3,9 @@ set(DWORLDSERVER_SOURCES
)
add_library(dWorldServer ${DWORLDSERVER_SOURCES})
target_link_libraries(dWorldServer PRIVATE dGame) # ${COMMON_LIBRARIES}
add_executable(WorldServer "WorldServer.cpp")
add_compile_definitions(WorldServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"")
target_link_libraries(dWorldServer ${COMMON_LIBRARIES})
target_link_libraries(WorldServer ${COMMON_LIBRARIES} dChatFilter dGame dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dNavigation)
target_link_libraries(WorldServer ${COMMON_LIBRARIES} dGame dChatFilter dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dNavigation)

View File

@ -7,3 +7,13 @@ add_library(dZoneManager STATIC ${DZONEMANAGER_SOURCES})
target_link_libraries(dZoneManager
PUBLIC dPhysics
INTERFACE dWorldServer)
target_include_directories(dZoneManager PUBLIC
${PROJECT_SOURCE_DIR}/dGame # Entity.h
${PROJECT_SOURCE_DIR}/dGame/dEntity # EntityInfo.h
PRIVATE
${PROJECT_SOURCE_DIR}/dGame/dComponents #InventoryComponent.h
${PROJECT_SOURCE_DIR}/dGame/dInventory #InventoryComponent.h (transitive)
${PROJECT_SOURCE_DIR}/dGame/dBehaviors #BehaviorSlot.h
${PROJECT_SOURCE_DIR}/dGame/dGameMessages #GameMessages.h
${PROJECT_SOURCE_DIR}/dGame/dUtilities #VanityUtilities.h
)

View File

@ -19,7 +19,7 @@ list(APPEND DCOMMONTEST_SOURCES ${DENUMS_TESTS})
add_executable(dCommonTests ${DCOMMONTEST_SOURCES})
# Link needed libraries
target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main)
target_link_libraries(dCommonTests ${COMMON_LIBRARIES} dGame GTest::gtest_main)
# Copy test files to testing directory
add_subdirectory(TestBitStreams)