From bfe39a919e6691503ad397fc28655556800ad9be Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Wed, 3 Jan 2024 21:13:47 +0100 Subject: [PATCH 01/26] fix: more include changes --- CMakeLists.txt | 11 ----------- dGame/CMakeLists.txt | 2 ++ dGame/dBehaviors/CMakeLists.txt | 9 ++++++++- dGame/dComponents/CMakeLists.txt | 11 ++++++++++- dGame/dGameMessages/CMakeLists.txt | 15 ++++++++++++++- dGame/dInventory/CMakeLists.txt | 10 ++++++++++ dGame/dMission/CMakeLists.txt | 9 +++++++++ dGame/dPropertyBehaviors/CMakeLists.txt | 5 +++++ dGame/dUtilities/CMakeLists.txt | 9 +++++++++ dNavigation/CMakeLists.txt | 3 ++- dNet/CMakeLists.txt | 8 ++++++-- dScripts/CMakeLists.txt | 14 ++++++++++---- dWorldServer/CMakeLists.txt | 6 +++--- dZoneManager/CMakeLists.txt | 10 ++++++++++ tests/dCommonTests/CMakeLists.txt | 2 +- 15 files changed, 99 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00c12e28d..5d35769b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" diff --git a/dGame/CMakeLists.txt b/dGame/CMakeLists.txt index ac7f38ccd..541536d47 100644 --- a/dGame/CMakeLists.txt +++ b/dGame/CMakeLists.txt @@ -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) diff --git a/dGame/dBehaviors/CMakeLists.txt b/dGame/dBehaviors/CMakeLists.txt index c8cb0be07..aa8aa5f78 100644 --- a/dGame/dBehaviors/CMakeLists.txt +++ b/dGame/dBehaviors/CMakeLists.txt @@ -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) diff --git a/dGame/dComponents/CMakeLists.txt b/dGame/dComponents/CMakeLists.txt index b14d0eb85..810cc74f8 100644 --- a/dGame/dComponents/CMakeLists.txt +++ b/dGame/dComponents/CMakeLists.txt @@ -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 diff --git a/dGame/dGameMessages/CMakeLists.txt b/dGame/dGameMessages/CMakeLists.txt index 7373633cc..c7d5b3fb0 100644 --- a/dGame/dGameMessages/CMakeLists.txt +++ b/dGame/dGameMessages/CMakeLists.txt @@ -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) diff --git a/dGame/dInventory/CMakeLists.txt b/dGame/dInventory/CMakeLists.txt index a663a97d4..f5dd25927 100644 --- a/dGame/dInventory/CMakeLists.txt +++ b/dGame/dInventory/CMakeLists.txt @@ -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) diff --git a/dGame/dMission/CMakeLists.txt b/dGame/dMission/CMakeLists.txt index 4e4bdec2b..fa3fcc9bc 100644 --- a/dGame/dMission/CMakeLists.txt +++ b/dGame/dMission/CMakeLists.txt @@ -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) diff --git a/dGame/dPropertyBehaviors/CMakeLists.txt b/dGame/dPropertyBehaviors/CMakeLists.txt index 47c8ff23e..618e57fc9 100644 --- a/dGame/dPropertyBehaviors/CMakeLists.txt +++ b/dGame/dPropertyBehaviors/CMakeLists.txt @@ -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) diff --git a/dGame/dUtilities/CMakeLists.txt b/dGame/dUtilities/CMakeLists.txt index 055cc7061..6d26cd5a5 100644 --- a/dGame/dUtilities/CMakeLists.txt +++ b/dGame/dUtilities/CMakeLists.txt @@ -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) diff --git a/dNavigation/CMakeLists.txt b/dNavigation/CMakeLists.txt index 4c03d24b2..d619631af 100644 --- a/dNavigation/CMakeLists.txt +++ b/dNavigation/CMakeLists.txt @@ -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) diff --git a/dNet/CMakeLists.txt b/dNet/CMakeLists.txt index b4b77c82b..bd22434c2 100644 --- a/dNet/CMakeLists.txt +++ b/dNet/CMakeLists.txt @@ -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) diff --git a/dScripts/CMakeLists.txt b/dScripts/CMakeLists.txt index b3fb7d447..588369621 100644 --- a/dScripts/CMakeLists.txt +++ b/dScripts/CMakeLists.txt @@ -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 diff --git a/dWorldServer/CMakeLists.txt b/dWorldServer/CMakeLists.txt index 336a60f92..2deb06350 100644 --- a/dWorldServer/CMakeLists.txt +++ b/dWorldServer/CMakeLists.txt @@ -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) \ No newline at end of file diff --git a/dZoneManager/CMakeLists.txt b/dZoneManager/CMakeLists.txt index e73823678..d1e6c0dd5 100644 --- a/dZoneManager/CMakeLists.txt +++ b/dZoneManager/CMakeLists.txt @@ -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 +) \ No newline at end of file diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index be23d8665..8d95e220f 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -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) From 0f1e226960ea90ead30d52382f1940d154a6a7e6 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Wed, 3 Jan 2024 21:31:50 +0100 Subject: [PATCH 02/26] fix: remove dZoneManager from global include --- CMakeLists.txt | 2 -- dGame/CMakeLists.txt | 4 +++- dGame/dBehaviors/CMakeLists.txt | 1 + dGame/dComponents/CMakeLists.txt | 1 + dGame/dGameMessages/CMakeLists.txt | 1 + dGame/dInventory/CMakeLists.txt | 1 + dGame/dMission/CMakeLists.txt | 1 + dGame/dUtilities/CMakeLists.txt | 1 + dMasterServer/CMakeLists.txt | 4 +++- dScripts/CMakeLists.txt | 1 + dZoneManager/CMakeLists.txt | 2 +- 11 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d35769b3..9486ef587 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -214,8 +214,6 @@ set(INCLUDED_DIRECTORIES "dNavigation" "dNavigation/dTerrain" - "dZoneManager" - "dDatabase" "dDatabase/CDClientDatabase" "dDatabase/CDClientDatabase/CDClientTables" diff --git a/dGame/CMakeLists.txt b/dGame/CMakeLists.txt index 541536d47..ba0dbf5ae 100644 --- a/dGame/CMakeLists.txt +++ b/dGame/CMakeLists.txt @@ -16,7 +16,9 @@ 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") + PRIVATE "dComponents" "dGameMessages" "dBehaviors" "dMission" "dUtilities" "dInventory" + "${PROJECT_SOURCE_DIR}/dZoneManager" +) target_link_libraries(dGameBase PUBLIC dDatabase dPhysics INTERFACE dComponents dEntity) diff --git a/dGame/dBehaviors/CMakeLists.txt b/dGame/dBehaviors/CMakeLists.txt index aa8aa5f78..6b6673565 100644 --- a/dGame/dBehaviors/CMakeLists.txt +++ b/dGame/dBehaviors/CMakeLists.txt @@ -65,5 +65,6 @@ target_include_directories(dBehaviors PUBLIC "." "${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 + "${PROJECT_SOURCE_DIR}/dZoneManager" # via BasicAttackBehavior.cpp ) target_precompile_headers(dBehaviors REUSE_FROM dGameBase) diff --git a/dGame/dComponents/CMakeLists.txt b/dGame/dComponents/CMakeLists.txt index 810cc74f8..1f294ef78 100644 --- a/dGame/dComponents/CMakeLists.txt +++ b/dGame/dComponents/CMakeLists.txt @@ -59,6 +59,7 @@ target_include_directories(dComponents PUBLIC "." "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # direct "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # direct Loot.h "${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager/Spawner.h + "${PROJECT_SOURCE_DIR}/dZoneManager" # via BouncerComponent.cpp, ActivityComponent.cpp ) target_precompile_headers(dComponents REUSE_FROM dGameBase) target_link_libraries(dComponents diff --git a/dGame/dGameMessages/CMakeLists.txt b/dGame/dGameMessages/CMakeLists.txt index c7d5b3fb0..7a043ddb1 100644 --- a/dGame/dGameMessages/CMakeLists.txt +++ b/dGame/dGameMessages/CMakeLists.txt @@ -18,5 +18,6 @@ target_include_directories(dGameMessages PUBLIC "." "${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 + "${PROJECT_SOURCE_DIR}/dZoneManager" # via GameMessages.cpp, GameMessageHandler.cpp ) target_precompile_headers(dGameMessages REUSE_FROM dGameBase) diff --git a/dGame/dInventory/CMakeLists.txt b/dGame/dInventory/CMakeLists.txt index f5dd25927..52d012bb7 100644 --- a/dGame/dInventory/CMakeLists.txt +++ b/dGame/dInventory/CMakeLists.txt @@ -14,6 +14,7 @@ target_include_directories(dInventory PUBLIC "." "${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 + "${PROJECT_SOURCE_DIR}/dZoneManager" # via Item.cpp ) target_link_libraries(dInventory INTERFACE dNet) target_precompile_headers(dInventory REUSE_FROM dGameBase) diff --git a/dGame/dMission/CMakeLists.txt b/dGame/dMission/CMakeLists.txt index fa3fcc9bc..edabd0bc5 100644 --- a/dGame/dMission/CMakeLists.txt +++ b/dGame/dMission/CMakeLists.txt @@ -13,5 +13,6 @@ target_include_directories(dMission PUBLIC "." "${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 + "${PROJECT_SOURCE_DIR}/dZoneManager" # via Mission.cpp, MissionTask.cpp ) target_precompile_headers(dMission REUSE_FROM dGameBase) diff --git a/dGame/dUtilities/CMakeLists.txt b/dGame/dUtilities/CMakeLists.txt index 6d26cd5a5..1b9a3e563 100644 --- a/dGame/dUtilities/CMakeLists.txt +++ b/dGame/dUtilities/CMakeLists.txt @@ -18,6 +18,7 @@ target_include_directories(dUtilities PUBLIC "." "${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 + "${PROJECT_SOURCE_DIR}/dZoneManager" # Mail.cpp ) target_link_libraries(dUtilities PUBLIC dDatabase dPhysics diff --git a/dMasterServer/CMakeLists.txt b/dMasterServer/CMakeLists.txt index 108cddc24..281c9f24b 100644 --- a/dMasterServer/CMakeLists.txt +++ b/dMasterServer/CMakeLists.txt @@ -7,7 +7,9 @@ set(DMASTERSERVER_SOURCES add_library(dMasterServer ${DMASTERSERVER_SOURCES}) add_executable(MasterServer "MasterServer.cpp") add_compile_definitions(MasterServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") - +target_include_directories(dMasterServer PUBLIC "." + "${PROJECT_SOURCE_DIR}/dZoneManager" # InstanceManager.h uses dZMCommon.h +) target_link_libraries(dMasterServer ${COMMON_LIBRARIES}) target_link_libraries(MasterServer ${COMMON_LIBRARIES} dMasterServer) diff --git a/dScripts/CMakeLists.txt b/dScripts/CMakeLists.txt index 588369621..2da73eb30 100644 --- a/dScripts/CMakeLists.txt +++ b/dScripts/CMakeLists.txt @@ -32,6 +32,7 @@ include_directories( "${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h "${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # viaInventoryComponent.h "${PROJECT_SOURCE_DIR}/dGame/dInventory" # via InventoryComponent.h + "${PROJECT_SOURCE_DIR}/dZoneManager" ) link_libraries(dScriptsBase) # dComponents diff --git a/dZoneManager/CMakeLists.txt b/dZoneManager/CMakeLists.txt index d1e6c0dd5..ef6c8092c 100644 --- a/dZoneManager/CMakeLists.txt +++ b/dZoneManager/CMakeLists.txt @@ -7,7 +7,7 @@ add_library(dZoneManager STATIC ${DZONEMANAGER_SOURCES}) target_link_libraries(dZoneManager PUBLIC dPhysics INTERFACE dWorldServer) -target_include_directories(dZoneManager PUBLIC +target_include_directories(dZoneManager PUBLIC "." ${PROJECT_SOURCE_DIR}/dGame # Entity.h ${PROJECT_SOURCE_DIR}/dGame/dEntity # EntityInfo.h PRIVATE From 7509237e69c955ebb54d9ad652de4440a9528fa5 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Wed, 3 Jan 2024 22:41:05 +0100 Subject: [PATCH 03/26] fix: dDatabase --- CMakeLists.txt | 36 +++++-------------- dCommon/CMakeLists.txt | 16 ++++++--- dDatabase/CDClientDatabase/CMakeLists.txt | 22 +++++++++++- dDatabase/CMakeLists.txt | 21 +++-------- dDatabase/GameDatabase/CMakeLists.txt | 20 +++++++++-- dDatabase/GameDatabase/ITables/IAccounts.h | 1 + .../{GameDatabase => }/MigrationRunner.cpp | 0 .../{GameDatabase => }/MigrationRunner.h | 0 dGame/dBehaviors/CMakeLists.txt | 2 +- dGame/dInventory/CMakeLists.txt | 2 +- dGame/dPropertyBehaviors/CMakeLists.txt | 1 + dZoneManager/CMakeLists.txt | 1 + thirdparty/CMakeLists.txt | 2 +- 13 files changed, 69 insertions(+), 55 deletions(-) rename dDatabase/{GameDatabase => }/MigrationRunner.cpp (100%) rename dDatabase/{GameDatabase => }/MigrationRunner.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9486ef587..6fbe4a007 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,7 @@ endif() # Our output dir set(CMAKE_BINARY_DIR ${PROJECT_BINARY_DIR}) +#set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) # unfortunately, serializes everything # TODO make this not have to override the build type directories set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}) @@ -201,6 +202,14 @@ foreach(file ${SQL_FILES}) configure_file(${CMAKE_SOURCE_DIR}/migrations/cdserver/${file} ${PROJECT_BINARY_DIR}/migrations/cdserver/${file}) endforeach() +# Add system specfic includes for Apple, Windows and Other Unix OS' (including Linux) +if (APPLE) + include_directories("/usr/local/include/") +endif() + +# Load all of our third party directories +add_subdirectory(thirdparty) + # Create our list of include directories set(INCLUDED_DIRECTORIES "dCommon" @@ -214,14 +223,6 @@ set(INCLUDED_DIRECTORIES "dNavigation" "dNavigation/dTerrain" - "dDatabase" - "dDatabase/CDClientDatabase" - "dDatabase/CDClientDatabase/CDClientTables" - "dDatabase/GameDatabase" - "dDatabase/GameDatabase/ITables" - "dDatabase/GameDatabase/MySQL" - "dDatabase/GameDatabase/MySQL/Tables" - "dNet" "thirdparty/magic_enum/include/magic_enum" @@ -257,19 +258,6 @@ include_directories("${PROJECT_SOURCE_DIR}/thirdparty/libbcrypt/include") # Add linking directories: link_directories(${PROJECT_BINARY_DIR}) -# Load all of our third party directories -add_subdirectory(thirdparty) - -# Glob together all headers that need to be precompiled -file( - GLOB HEADERS_DDATABASE - LIST_DIRECTORIES false - ${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/*.h - ${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/CDClientTables/*.h - ${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase/ITables/*.h - ${PROJECT_SOURCE_DIR}/thirdparty/SQLite/*.h -) - file( GLOB HEADERS_DZONEMANAGER LIST_DIRECTORIES false @@ -325,12 +313,6 @@ target_precompile_headers( ${HEADERS_DZONEMANAGER} ) -# Need to specify to use the CXX compiler language here or else we get errors including . -target_precompile_headers( - dDatabase PRIVATE - "$<$:${HEADERS_DDATABASE}>" -) - target_precompile_headers( dCommon PRIVATE ${HEADERS_DCOMMON} diff --git a/dCommon/CMakeLists.txt b/dCommon/CMakeLists.txt index 5300a4f27..419462de1 100644 --- a/dCommon/CMakeLists.txt +++ b/dCommon/CMakeLists.txt @@ -26,11 +26,15 @@ foreach(file ${DCOMMON_DCLIENT_SOURCES}) set(DCOMMON_SOURCES ${DCOMMON_SOURCES} "dClient/${file}") endforeach() -include_directories(${PROJECT_SOURCE_DIR}/dCommon/) - add_library(dCommon STATIC ${DCOMMON_SOURCES}) - -target_link_libraries(dCommon bcrypt dDatabase tinyxml2) +target_include_directories(dCommon + PUBLIC "." "dClient" "dEnums" + PRIVATE + "${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase" + "${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase/ITables" + "${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase" + "${PROJECT_SOURCE_DIR}/thirdparty/mariadb-connector-cpp/include" +) if (UNIX) find_package(ZLIB REQUIRED) @@ -61,4 +65,6 @@ else () ) endif () -target_link_libraries(dCommon ZLIB::ZLIB) +target_link_libraries(dCommon + PRIVATE ZLIB::ZLIB bcrypt tinyxml2 + INTERFACE dDatabase) diff --git a/dDatabase/CDClientDatabase/CMakeLists.txt b/dDatabase/CDClientDatabase/CMakeLists.txt index 2645c2155..f83bd6a45 100644 --- a/dDatabase/CDClientDatabase/CMakeLists.txt +++ b/dDatabase/CDClientDatabase/CMakeLists.txt @@ -9,4 +9,24 @@ foreach(file ${DDATABASE_CDCLIENTDATABASE_CDCLIENTTABLES_SOURCES}) set(DDATABASE_CDCLIENTDATABASE_SOURCES ${DDATABASE_CDCLIENTDATABASE_SOURCES} "CDClientTables/${file}") endforeach() -set(DDATABASE_CDCLIENTDATABASE_SOURCES ${DDATABASE_CDCLIENTDATABASE_SOURCES} PARENT_SCOPE) +add_library(dDatabaseCDClient STATIC ${DDATABASE_CDCLIENTDATABASE_SOURCES}) +target_include_directories(dDatabaseCDClient PUBLIC "." "CDClientTables") +target_link_libraries(dDatabaseCDClient PRIVATE sqlite3) + +if (${CDCLIENT_CACHE_ALL}) + add_compile_definitions(dDatabaseCDClient PRIVATE CDCLIENT_CACHE_ALL=${CDCLIENT_CACHE_ALL}) +endif() + +file( + GLOB HEADERS_DDATABASE_CDCLIENT + LIST_DIRECTORIES false + ${PROJECT_SOURCE_DIR}/thirdparty/SQLite/*.h + CDClientTables/*.h + *.h +) + +# Need to specify to use the CXX compiler language here or else we get errors including . +target_precompile_headers( + dDatabaseCDClient PRIVATE + "$<$:${HEADERS_DDATABASE_CDCLIENT}>" +) diff --git a/dDatabase/CMakeLists.txt b/dDatabase/CMakeLists.txt index f0fe54b4e..004bdc147 100644 --- a/dDatabase/CMakeLists.txt +++ b/dDatabase/CMakeLists.txt @@ -1,20 +1,7 @@ -set(DDATABASE_SOURCES) - add_subdirectory(CDClientDatabase) - -foreach(file ${DDATABASE_CDCLIENTDATABASE_SOURCES}) - set(DDATABASE_SOURCES ${DDATABASE_SOURCES} "CDClientDatabase/${file}") -endforeach() - add_subdirectory(GameDatabase) -foreach(file ${DDATABASE_GAMEDATABASE_SOURCES}) - set(DDATABASE_SOURCES ${DDATABASE_SOURCES} "GameDatabase/${file}") -endforeach() - -add_library(dDatabase STATIC ${DDATABASE_SOURCES}) -target_link_libraries(dDatabase sqlite3 mariadbConnCpp) - -if (${CDCLIENT_CACHE_ALL}) - add_compile_definitions(dDatabase CDCLIENT_CACHE_ALL=${CDCLIENT_CACHE_ALL}) -endif() +add_library(dDatabase STATIC "MigrationRunner.cpp") +target_include_directories(dDatabase PUBLIC ".") +target_link_libraries(dDatabase + PUBLIC dDatabaseCDClient dDatabaseGame) diff --git a/dDatabase/GameDatabase/CMakeLists.txt b/dDatabase/GameDatabase/CMakeLists.txt index c32007bb7..c9897e2e9 100644 --- a/dDatabase/GameDatabase/CMakeLists.txt +++ b/dDatabase/GameDatabase/CMakeLists.txt @@ -1,6 +1,5 @@ set(DDATABASE_GAMEDATABASE_SOURCES "Database.cpp" - "MigrationRunner.cpp" ) add_subdirectory(MySQL) @@ -9,4 +8,21 @@ foreach(file ${DDATABSE_DATABSES_MYSQL_SOURCES}) set(DDATABASE_GAMEDATABASE_SOURCES ${DDATABASE_GAMEDATABASE_SOURCES} "MySQL/${file}") endforeach() -set(DDATABASE_GAMEDATABASE_SOURCES ${DDATABASE_GAMEDATABASE_SOURCES} PARENT_SCOPE) +add_library(dDatabaseGame STATIC ${DDATABASE_GAMEDATABASE_SOURCES}) +target_include_directories(dDatabaseGame PUBLIC "." "ITables" PRIVATE "MySQL") +target_link_libraries(dDatabaseGame + PUBLIC mariadbConnCpp + INTERFACE dCommon) + +# Glob together all headers that need to be precompiled +file( + GLOB HEADERS_DDATABASE_GAME + LIST_DIRECTORIES false + ITables/*.h +) + +# Need to specify to use the CXX compiler language here or else we get errors including . +target_precompile_headers( + dDatabaseGame PRIVATE + "$<$:${HEADERS_DDATABASE_GAME}>" +) diff --git a/dDatabase/GameDatabase/ITables/IAccounts.h b/dDatabase/GameDatabase/ITables/IAccounts.h index 1b1f85a74..3f27dda6b 100644 --- a/dDatabase/GameDatabase/ITables/IAccounts.h +++ b/dDatabase/GameDatabase/ITables/IAccounts.h @@ -3,6 +3,7 @@ #include #include +#include #include enum class eGameMasterLevel : uint8_t; diff --git a/dDatabase/GameDatabase/MigrationRunner.cpp b/dDatabase/MigrationRunner.cpp similarity index 100% rename from dDatabase/GameDatabase/MigrationRunner.cpp rename to dDatabase/MigrationRunner.cpp diff --git a/dDatabase/GameDatabase/MigrationRunner.h b/dDatabase/MigrationRunner.h similarity index 100% rename from dDatabase/GameDatabase/MigrationRunner.h rename to dDatabase/MigrationRunner.h diff --git a/dGame/dBehaviors/CMakeLists.txt b/dGame/dBehaviors/CMakeLists.txt index 6b6673565..92afb7b0d 100644 --- a/dGame/dBehaviors/CMakeLists.txt +++ b/dGame/dBehaviors/CMakeLists.txt @@ -57,7 +57,7 @@ set(DGAME_DBEHAVIORS_SOURCES "AirMovementBehavior.cpp" "VerifyBehavior.cpp") add_library(dBehaviors STATIC ${DGAME_DBEHAVIORS_SOURCES}) -target_link_libraries(dBehaviors PUBLIC dPhysics) +target_link_libraries(dBehaviors PUBLIC dDatabaseCDClient dPhysics) target_include_directories(dBehaviors PUBLIC "." "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # via BehaviorContext.h PRIVATE diff --git a/dGame/dInventory/CMakeLists.txt b/dGame/dInventory/CMakeLists.txt index 52d012bb7..c4bcc11e5 100644 --- a/dGame/dInventory/CMakeLists.txt +++ b/dGame/dInventory/CMakeLists.txt @@ -16,5 +16,5 @@ target_include_directories(dInventory PUBLIC "." "${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h "${PROJECT_SOURCE_DIR}/dZoneManager" # via Item.cpp ) -target_link_libraries(dInventory INTERFACE dNet) +target_link_libraries(dInventory PRIVATE dDatabaseCDClient INTERFACE dNet) target_precompile_headers(dInventory REUSE_FROM dGameBase) diff --git a/dGame/dPropertyBehaviors/CMakeLists.txt b/dGame/dPropertyBehaviors/CMakeLists.txt index 618e57fc9..42fe7449a 100644 --- a/dGame/dPropertyBehaviors/CMakeLists.txt +++ b/dGame/dPropertyBehaviors/CMakeLists.txt @@ -13,6 +13,7 @@ foreach(file ${DGAME_DPROPERTYBEHAVIORS_CONTROLBEHAVIORMESSAGES}) endforeach() add_library(dPropertyBehaviors STATIC ${DGAME_DPROPERTYBEHAVIORS_SOURCES}) +target_link_libraries(dPropertyBehaviors PRIVATE dDatabaseCDClient) target_include_directories(dPropertyBehaviors PUBLIC "." "ControlBehaviorMessages" PRIVATE "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # GameMessages.h diff --git a/dZoneManager/CMakeLists.txt b/dZoneManager/CMakeLists.txt index ef6c8092c..0b2f5252f 100644 --- a/dZoneManager/CMakeLists.txt +++ b/dZoneManager/CMakeLists.txt @@ -5,6 +5,7 @@ set(DZONEMANAGER_SOURCES "dZoneManager.cpp" add_library(dZoneManager STATIC ${DZONEMANAGER_SOURCES}) target_link_libraries(dZoneManager + PRIVATE dDatabaseCDClient PUBLIC dPhysics INTERFACE dWorldServer) target_include_directories(dZoneManager PUBLIC "." diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 11d278c08..12667df82 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -19,7 +19,7 @@ add_library(bcrypt ${SOURCES_LIBBCRYPT}) # Because we are not using the libbcrypt CMakeLists.txt, we need to include these headers for the library to use. # fortunately they are only needed for building the libbcrypt directory and nothing else, so these are marked private. -target_include_directories(bcrypt PRIVATE "libbcrypt/include") +target_include_directories(bcrypt PRIVATE "libbcrypt/include/bcrypt") target_include_directories(bcrypt PRIVATE "libbcrypt/src") # Source code for sqlite From 4586a0ffea7e6fbb270a8282345ae436d77ec459 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Wed, 3 Jan 2024 23:08:32 +0100 Subject: [PATCH 04/26] fix: dCommon --- CMakeLists.txt | 4 ---- dDatabase/CDClientDatabase/CMakeLists.txt | 6 +++++- dDatabase/GameDatabase/CMakeLists.txt | 6 +++++- dGame/dInventory/CMakeLists.txt | 1 + dGame/dPropertyBehaviors/CMakeLists.txt | 1 + dPhysics/CMakeLists.txt | 6 +++++- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fbe4a007..5463f8a30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,10 +212,6 @@ add_subdirectory(thirdparty) # Create our list of include directories set(INCLUDED_DIRECTORIES - "dCommon" - "dCommon/dClient" - "dCommon/dEnums" - "dChatFilter" "dPhysics" diff --git a/dDatabase/CDClientDatabase/CMakeLists.txt b/dDatabase/CDClientDatabase/CMakeLists.txt index f83bd6a45..13d59ffbc 100644 --- a/dDatabase/CDClientDatabase/CMakeLists.txt +++ b/dDatabase/CDClientDatabase/CMakeLists.txt @@ -10,7 +10,11 @@ foreach(file ${DDATABASE_CDCLIENTDATABASE_CDCLIENTTABLES_SOURCES}) endforeach() add_library(dDatabaseCDClient STATIC ${DDATABASE_CDCLIENTDATABASE_SOURCES}) -target_include_directories(dDatabaseCDClient PUBLIC "." "CDClientTables") +target_include_directories(dDatabaseCDClient PUBLIC "." + "CDClientTables" + "${PROJECT_SOURCE_DIR}/dCommon" + "${PROJECT_SOURCE_DIR}/dCommon/dEnums" +) target_link_libraries(dDatabaseCDClient PRIVATE sqlite3) if (${CDCLIENT_CACHE_ALL}) diff --git a/dDatabase/GameDatabase/CMakeLists.txt b/dDatabase/GameDatabase/CMakeLists.txt index c9897e2e9..8805b267a 100644 --- a/dDatabase/GameDatabase/CMakeLists.txt +++ b/dDatabase/GameDatabase/CMakeLists.txt @@ -9,7 +9,11 @@ foreach(file ${DDATABSE_DATABSES_MYSQL_SOURCES}) endforeach() add_library(dDatabaseGame STATIC ${DDATABASE_GAMEDATABASE_SOURCES}) -target_include_directories(dDatabaseGame PUBLIC "." "ITables" PRIVATE "MySQL") +target_include_directories(dDatabaseGame PUBLIC "." + "ITables" PRIVATE "MySQL" + "${PROJECT_SOURCE_DIR}/dCommon" + "${PROJECT_SOURCE_DIR}/dCommon/dEnums" +) target_link_libraries(dDatabaseGame PUBLIC mariadbConnCpp INTERFACE dCommon) diff --git a/dGame/dInventory/CMakeLists.txt b/dGame/dInventory/CMakeLists.txt index c4bcc11e5..605c6df0d 100644 --- a/dGame/dInventory/CMakeLists.txt +++ b/dGame/dInventory/CMakeLists.txt @@ -9,6 +9,7 @@ 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}/dCommon/dClient" # Item.cpp uses AssetManager "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # direct "${PROJECT_SOURCE_DIR}/dGame/dComponents" # direct InventoryComponent.h "${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h diff --git a/dGame/dPropertyBehaviors/CMakeLists.txt b/dGame/dPropertyBehaviors/CMakeLists.txt index 42fe7449a..201f5ae81 100644 --- a/dGame/dPropertyBehaviors/CMakeLists.txt +++ b/dGame/dPropertyBehaviors/CMakeLists.txt @@ -16,6 +16,7 @@ add_library(dPropertyBehaviors STATIC ${DGAME_DPROPERTYBEHAVIORS_SOURCES}) target_link_libraries(dPropertyBehaviors PRIVATE dDatabaseCDClient) target_include_directories(dPropertyBehaviors PUBLIC "." "ControlBehaviorMessages" PRIVATE + "${PROJECT_SOURCE_DIR}/dCommon/dClient" # ControlBehaviors.cpp uses AssetManager "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # GameMessages.h "${PROJECT_SOURCE_DIR}/dGame/dComponents" # ModelComponent.h ) diff --git a/dPhysics/CMakeLists.txt b/dPhysics/CMakeLists.txt index 340e4c3c3..65588b4b9 100644 --- a/dPhysics/CMakeLists.txt +++ b/dPhysics/CMakeLists.txt @@ -7,6 +7,10 @@ set(DPHYSICS_SOURCES "dpCollisionChecks.cpp" "dpWorld.cpp") add_library(dPhysics STATIC ${DPHYSICS_SOURCES}) +target_include_directories(dPhysics PUBLIC "." + "${PROJECT_SOURCE_DIR}/dCommon" + "${PROJECT_SOURCE_DIR}/dCommon/dEnums" +) target_link_libraries(dPhysics PUBLIC Recast Detour - INTERFACE dNavigation) + INTERFACE dNavigation dCommon) From d67ac7759b053ab652bcdd9028f3e433eb984d87 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Thu, 4 Jan 2024 02:58:51 +0100 Subject: [PATCH 05/26] fix: object libs --- CMakeLists.txt | 2 +- dGame/CMakeLists.txt | 44 +++++++++++++++---- dGame/dBehaviors/CMakeLists.txt | 2 +- dGame/dComponents/CMakeLists.txt | 24 ++++++++-- dGame/dEntity/CMakeLists.txt | 2 +- dGame/dGameMessages/CMakeLists.txt | 2 +- dGame/dInventory/CMakeLists.txt | 15 ++++++- dGame/dMission/CMakeLists.txt | 2 +- dGame/dPropertyBehaviors/CMakeLists.txt | 4 +- dGame/dUtilities/CMakeLists.txt | 2 +- dNavigation/CMakeLists.txt | 11 +++-- dNet/CMakeLists.txt | 19 ++++++-- dScripts/02_server/CMakeLists.txt | 26 ++++++++--- dScripts/02_server/Enemy/CMakeLists.txt | 2 +- dScripts/02_server/Map/AG/CMakeLists.txt | 2 +- .../Map/AG_Spider_Queen/CMakeLists.txt | 2 +- dScripts/02_server/Map/AM/CMakeLists.txt | 2 +- dScripts/02_server/Map/CMakeLists.txt | 44 +++++++++++++------ dScripts/02_server/Map/FV/CMakeLists.txt | 2 +- dScripts/02_server/Map/GF/CMakeLists.txt | 2 +- dScripts/02_server/Map/General/CMakeLists.txt | 2 +- dScripts/02_server/Map/NS/CMakeLists.txt | 2 +- dScripts/02_server/Map/NT/CMakeLists.txt | 2 +- dScripts/02_server/Map/PR/CMakeLists.txt | 2 +- .../02_server/Map/Property/CMakeLists.txt | 2 +- dScripts/02_server/Map/SS/CMakeLists.txt | 2 +- dScripts/02_server/Map/VE/CMakeLists.txt | 2 +- dScripts/02_server/Map/njhub/CMakeLists.txt | 2 +- dScripts/02_server/Pets/CMakeLists.txt | 2 +- dScripts/CMakeLists.txt | 35 ++++++++------- dScripts/EquipmentScripts/CMakeLists.txt | 2 +- dScripts/EquipmentTriggers/CMakeLists.txt | 2 +- dScripts/ai/ACT/CMakeLists.txt | 2 +- dScripts/ai/AG/CMakeLists.txt | 2 +- dScripts/ai/CMakeLists.txt | 44 +++++++++++++------ dScripts/ai/FV/CMakeLists.txt | 2 +- dScripts/ai/GENERAL/CMakeLists.txt | 2 +- dScripts/ai/GF/CMakeLists.txt | 2 +- dScripts/ai/MINIGAME/CMakeLists.txt | 2 +- dScripts/ai/NP/CMakeLists.txt | 2 +- dScripts/ai/NS/CMakeLists.txt | 2 +- dScripts/ai/PETS/CMakeLists.txt | 2 +- dScripts/ai/PROPERTY/CMakeLists.txt | 2 +- dScripts/ai/RACING/CMakeLists.txt | 2 +- dScripts/ai/SPEC/CMakeLists.txt | 2 +- dScripts/ai/WILD/CMakeLists.txt | 2 +- dScripts/client/CMakeLists.txt | 2 +- dScripts/zone/CMakeLists.txt | 2 +- dWorldServer/CMakeLists.txt | 13 ++++-- dZoneManager/CMakeLists.txt | 8 ++-- tests/dGameTests/CMakeLists.txt | 3 +- 51 files changed, 251 insertions(+), 115 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5463f8a30..d857670b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,7 +252,7 @@ endif() include_directories("${PROJECT_SOURCE_DIR}/thirdparty/libbcrypt/include") # Add linking directories: -link_directories(${PROJECT_BINARY_DIR}) +# link_directories(${PROJECT_BINARY_DIR}) file( GLOB HEADERS_DZONEMANAGER diff --git a/dGame/CMakeLists.txt b/dGame/CMakeLists.txt index ba0dbf5ae..b40d4e531 100644 --- a/dGame/CMakeLists.txt +++ b/dGame/CMakeLists.txt @@ -13,15 +13,24 @@ include_directories( ${PROJECT_SOURCE_DIR}/dGame ) -add_library(dGameBase ${DGAME_SOURCES}) +add_library(dGameBase OBJECT ${DGAME_SOURCES}) target_precompile_headers(dGameBase PRIVATE ${HEADERS_DGAME}) target_include_directories(dGameBase PUBLIC "." "dEntity" PRIVATE "dComponents" "dGameMessages" "dBehaviors" "dMission" "dUtilities" "dInventory" - "${PROJECT_SOURCE_DIR}/dZoneManager" + "${PROJECT_SOURCE_DIR}/dCommon" + "${PROJECT_SOURCE_DIR}/dCommon/dEnums" + "${PROJECT_SOURCE_DIR}/dCommon/dClient" + # dDatabase + "${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase" + "${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/CDClientTables" + "${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase" + "${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase/ITables" + "${PROJECT_SOURCE_DIR}/thirdparty/mariadb-connector-cpp/include" + # dPhysics + "${PROJECT_SOURCE_DIR}/thirdparty/recastnavigation/Recast/Include" + "${PROJECT_SOURCE_DIR}/thirdparty/recastnavigation/Detour/Include" + "${PROJECT_SOURCE_DIR}/dZoneManager" ) -target_link_libraries(dGameBase - PUBLIC dDatabase dPhysics - INTERFACE dComponents dEntity) add_subdirectory(dBehaviors) add_subdirectory(dComponents) @@ -32,7 +41,26 @@ add_subdirectory(dMission) add_subdirectory(dPropertyBehaviors) add_subdirectory(dUtilities) -add_library(dGame INTERFACE) -target_link_libraries(dGame INTERFACE - dGameBase dBehaviors dComponents dEntity dGameMessages dInventory dMission dPropertyBehaviors dUtilities dScripts +add_library(dGame STATIC + $ + $ + $ + $ + $ + $ + $ + $ + $ ) +target_link_libraries(dGame INTERFACE dNet) +target_include_directories(dGame INTERFACE + $ + $ + $ + $ + $ + $ + $ + $ + $ +) \ No newline at end of file diff --git a/dGame/dBehaviors/CMakeLists.txt b/dGame/dBehaviors/CMakeLists.txt index 92afb7b0d..e8e0d6d70 100644 --- a/dGame/dBehaviors/CMakeLists.txt +++ b/dGame/dBehaviors/CMakeLists.txt @@ -56,7 +56,7 @@ set(DGAME_DBEHAVIORS_SOURCES "AirMovementBehavior.cpp" "VentureVisionBehavior.cpp" "VerifyBehavior.cpp") -add_library(dBehaviors STATIC ${DGAME_DBEHAVIORS_SOURCES}) +add_library(dBehaviors OBJECT ${DGAME_DBEHAVIORS_SOURCES}) target_link_libraries(dBehaviors PUBLIC dDatabaseCDClient dPhysics) target_include_directories(dBehaviors PUBLIC "." "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # via BehaviorContext.h diff --git a/dGame/dComponents/CMakeLists.txt b/dGame/dComponents/CMakeLists.txt index 1f294ef78..4b691154e 100644 --- a/dGame/dComponents/CMakeLists.txt +++ b/dGame/dComponents/CMakeLists.txt @@ -49,12 +49,23 @@ set(DGAME_DCOMPONENTS_SOURCES "MiniGameControlComponent.cpp" ) -add_library(dComponents STATIC ${DGAME_DCOMPONENTS_SOURCES}) +add_library(dComponents OBJECT ${DGAME_DCOMPONENTS_SOURCES}) 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}/dCommon" + "${PROJECT_SOURCE_DIR}/dCommon/dEnums" + "${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase" + "${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/CDClientTables" + "${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase" + "${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase/ITables" + "${PROJECT_SOURCE_DIR}/thirdparty/mariadb-connector-cpp/include" + # dPhysics (via dpWorld.h) + "${PROJECT_SOURCE_DIR}/thirdparty/recastnavigation/Recast/Include" + "${PROJECT_SOURCE_DIR}/thirdparty/recastnavigation/Detour/Include" + "${PROJECT_SOURCE_DIR}/dScripts/02_server/Map/General" # PetDigServer.h "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # direct "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # direct Loot.h @@ -62,6 +73,11 @@ target_include_directories(dComponents PUBLIC "." "${PROJECT_SOURCE_DIR}/dZoneManager" # via BouncerComponent.cpp, ActivityComponent.cpp ) target_precompile_headers(dComponents REUSE_FROM dGameBase) -target_link_libraries(dComponents - PUBLIC dPhysics dDatabase - INTERFACE dUtilities dCommon dBehaviors dChatFilter dMission dInventory) + +# INTERFACE link w/o dependency +#set_property(TARGET dComponents APPEND PROPERTY INTERFACE_LINK_LIBRARIES +# dUtilities dCommon dBehaviors dChatFilter dMission dInventory +# dPhysics +#) + +target_link_libraries(dComponents INTERFACE dBehaviors) \ No newline at end of file diff --git a/dGame/dEntity/CMakeLists.txt b/dGame/dEntity/CMakeLists.txt index d7d96e147..2a418fb9e 100644 --- a/dGame/dEntity/CMakeLists.txt +++ b/dGame/dEntity/CMakeLists.txt @@ -2,6 +2,6 @@ set(DGAME_DENTITY_SOURCES "EntityCallbackTimer.cpp" "EntityTimer.cpp") -add_library(dEntity STATIC ${DGAME_DENTITY_SOURCES}) +add_library(dEntity OBJECT ${DGAME_DENTITY_SOURCES}) target_include_directories(dEntity PUBLIC ".") target_precompile_headers(dEntity REUSE_FROM dGameBase) diff --git a/dGame/dGameMessages/CMakeLists.txt b/dGame/dGameMessages/CMakeLists.txt index 7a043ddb1..0f28dea4f 100644 --- a/dGame/dGameMessages/CMakeLists.txt +++ b/dGame/dGameMessages/CMakeLists.txt @@ -4,7 +4,7 @@ set(DGAME_DGAMEMESSAGES_SOURCES "PropertyDataMessage.cpp" "PropertySelectQueryProperty.cpp") -add_library(dGameMessages STATIC ${DGAME_DGAMEMESSAGES_SOURCES}) +add_library(dGameMessages OBJECT ${DGAME_DGAMEMESSAGES_SOURCES}) target_link_libraries(dGameMessages PUBLIC dDatabase INTERFACE dGameBase # TradingManager diff --git a/dGame/dInventory/CMakeLists.txt b/dGame/dInventory/CMakeLists.txt index 605c6df0d..c31931b68 100644 --- a/dGame/dInventory/CMakeLists.txt +++ b/dGame/dInventory/CMakeLists.txt @@ -5,11 +5,18 @@ set(DGAME_DINVENTORY_SOURCES "ItemSet.cpp" "ItemSetPassiveAbility.cpp") -add_library(dInventory STATIC ${DGAME_DINVENTORY_SOURCES}) +add_library(dInventory OBJECT ${DGAME_DINVENTORY_SOURCES}) target_include_directories(dInventory PUBLIC "." "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # Item.h uses Preconditions.h + "${PROJECT_SOURCE_DIR}/dCommon/eEnums" # Item.h uses dCommonVars.h PRIVATE + "${PROJECT_SOURCE_DIR}/dCommon" + "${PROJECT_SOURCE_DIR}/dCommon/dEnums" "${PROJECT_SOURCE_DIR}/dCommon/dClient" # Item.cpp uses AssetManager + + "${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase" + "${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/CDClientTables" + "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # direct "${PROJECT_SOURCE_DIR}/dGame/dComponents" # direct InventoryComponent.h "${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h @@ -17,5 +24,9 @@ target_include_directories(dInventory PUBLIC "." "${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h "${PROJECT_SOURCE_DIR}/dZoneManager" # via Item.cpp ) -target_link_libraries(dInventory PRIVATE dDatabaseCDClient INTERFACE dNet) target_precompile_headers(dInventory REUSE_FROM dGameBase) + +# INTERFACE link w/o dependency +#set_property(TARGET dInventory APPEND PROPERTY INTERFACE_LINK_LIBRARIES +# dNet dDatabaseCDClient +#) diff --git a/dGame/dMission/CMakeLists.txt b/dGame/dMission/CMakeLists.txt index edabd0bc5..51f74c37d 100644 --- a/dGame/dMission/CMakeLists.txt +++ b/dGame/dMission/CMakeLists.txt @@ -3,7 +3,7 @@ set(DGAME_DMISSION_SOURCES "MissionPrerequisites.cpp" "MissionTask.cpp") -add_library(dMission STATIC ${DGAME_DMISSION_SOURCES}) +add_library(dMission OBJECT ${DGAME_DMISSION_SOURCES}) target_link_libraries(dMission PUBLIC dDatabase) target_include_directories(dMission PUBLIC "." PRIVATE diff --git a/dGame/dPropertyBehaviors/CMakeLists.txt b/dGame/dPropertyBehaviors/CMakeLists.txt index 201f5ae81..e3984086c 100644 --- a/dGame/dPropertyBehaviors/CMakeLists.txt +++ b/dGame/dPropertyBehaviors/CMakeLists.txt @@ -12,7 +12,7 @@ foreach(file ${DGAME_DPROPERTYBEHAVIORS_CONTROLBEHAVIORMESSAGES}) set(DGAME_DPROPERTYBEHAVIORS_SOURCES ${DGAME_DPROPERTYBEHAVIORS_SOURCES} "ControlBehaviorMessages/${file}") endforeach() -add_library(dPropertyBehaviors STATIC ${DGAME_DPROPERTYBEHAVIORS_SOURCES}) +add_library(dPropertyBehaviors OBJECT ${DGAME_DPROPERTYBEHAVIORS_SOURCES}) target_link_libraries(dPropertyBehaviors PRIVATE dDatabaseCDClient) target_include_directories(dPropertyBehaviors PUBLIC "." "ControlBehaviorMessages" PRIVATE @@ -21,3 +21,5 @@ target_include_directories(dPropertyBehaviors PUBLIC "." "ControlBehaviorMessage "${PROJECT_SOURCE_DIR}/dGame/dComponents" # ModelComponent.h ) target_precompile_headers(dPropertyBehaviors REUSE_FROM dGameBase) + +target_link_libraries(dPropertyBehaviors INTERFACE dComponents) diff --git a/dGame/dUtilities/CMakeLists.txt b/dGame/dUtilities/CMakeLists.txt index 1b9a3e563..1e54b59b8 100644 --- a/dGame/dUtilities/CMakeLists.txt +++ b/dGame/dUtilities/CMakeLists.txt @@ -8,7 +8,7 @@ set(DGAME_DUTILITIES_SOURCES "BrickDatabase.cpp" "SlashCommandHandler.cpp" "VanityUtilities.cpp") -add_library(dUtilities STATIC ${DGAME_DUTILITIES_SOURCES}) +add_library(dUtilities OBJECT ${DGAME_DUTILITIES_SOURCES}) target_precompile_headers(dUtilities REUSE_FROM dGameBase) target_include_directories(dUtilities PUBLIC "." PRIVATE diff --git a/dNavigation/CMakeLists.txt b/dNavigation/CMakeLists.txt index d619631af..c2a53ca27 100644 --- a/dNavigation/CMakeLists.txt +++ b/dNavigation/CMakeLists.txt @@ -6,6 +6,11 @@ foreach(file ${DNAVIGATIONS_DTERRAIN_SOURCES}) set(DNAVIGATION_SOURCES ${DNAVIGATION_SOURCES} "dTerrain/${file}") endforeach() -add_library(dNavigation STATIC ${DNAVIGATION_SOURCES}) -target_link_libraries(dNavigation - PRIVATE Detour Recast dZoneManager) +add_library(dNavigation OBJECT ${DNAVIGATION_SOURCES}) +target_include_directories(dNavigation PUBLIC "." + PRIVATE + "${PROJECT_SOURCE_DIR}/dZoneManager" + "${PROJECT_SOURCE_DIR}/dGame" + "${PROJECT_SOURCE_DIR}/dGame/dEntity" +) +target_link_libraries(dNavigation PRIVATE Detour Recast dCommon) diff --git a/dNet/CMakeLists.txt b/dNet/CMakeLists.txt index bd22434c2..f3f57ba48 100644 --- a/dNet/CMakeLists.txt +++ b/dNet/CMakeLists.txt @@ -9,13 +9,26 @@ set(DNET_SOURCES "AuthPackets.cpp" add_library(dNet STATIC ${DNET_SOURCES}) target_include_directories(dNet PRIVATE + ${PROJECT_SOURCE_DIR}/dCommon + ${PROJECT_SOURCE_DIR}/dCommon/dEnums + + ${PROJECT_SOURCE_DIR}/dZoneManager + + ${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase + ${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/CDClientTables + ${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase + ${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase/ITables + ${PROJECT_SOURCE_DIR}/thirdparty/mariadb-connector-cpp/include + ${PROJECT_SOURCE_DIR}/dGame # UserManager.h ${PROJECT_SOURCE_DIR}/dGame/dComponents + ${PROJECT_SOURCE_DIR}/dGame/dEntity # via dZoneManager ${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 - PRIVATE dZoneManager) + +#set_property(TARGET dNet APPEND PROPERTY INTERFACE_LINK_LIBRARIES +# dCommon dDatabase +#) diff --git a/dScripts/02_server/CMakeLists.txt b/dScripts/02_server/CMakeLists.txt index 51eb24c8a..53a8ee467 100644 --- a/dScripts/02_server/CMakeLists.txt +++ b/dScripts/02_server/CMakeLists.txt @@ -30,15 +30,29 @@ endforeach() add_subdirectory(Pets) -add_library(dScriptsServer STATIC ${DSCRIPTS_SOURCES_02_SERVER}) -target_include_directories(dScriptsServer PUBLIC "." +add_library(dScriptsServerBase OBJECT ${DSCRIPTS_SOURCES_02_SERVER}) +target_include_directories(dScriptsServerBase PUBLIC "." "DLU" "Equipment" "Minigame" "Minigame/General" "Objects" - "Pets") +) +target_precompile_headers(dScriptsServerBase REUSE_FROM dScriptsBase) + +add_library(dScriptsServer INTERFACE) +target_sources(dScriptsServer INTERFACE + $ + $ + $ +) target_link_libraries(dScriptsServer INTERFACE - dScriptsServerEnemy - dScriptsServerMap) -target_precompile_headers(dScriptsServer REUSE_FROM dScriptsBase) + dScriptsServerMap +) +target_include_directories(dScriptsServer INTERFACE + $ + $ + $ + $ +) + diff --git a/dScripts/02_server/Enemy/CMakeLists.txt b/dScripts/02_server/Enemy/CMakeLists.txt index 62f617728..3c39721ce 100644 --- a/dScripts/02_server/Enemy/CMakeLists.txt +++ b/dScripts/02_server/Enemy/CMakeLists.txt @@ -42,7 +42,7 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_ENEMY_WAVES}) set(DSCRIPTS_SOURCES_02_SERVER_ENEMY ${DSCRIPTS_SOURCES_02_SERVER_ENEMY} "Waves/${file}") endforeach() -add_library(dScriptsServerEnemy STATIC ${DSCRIPTS_SOURCES_02_SERVER_ENEMY}) +add_library(dScriptsServerEnemy OBJECT ${DSCRIPTS_SOURCES_02_SERVER_ENEMY}) target_link_libraries(dScriptsServerEnemy dScriptsBase) target_include_directories(dScriptsServerEnemy PUBLIC "." "AG" diff --git a/dScripts/02_server/Map/AG/CMakeLists.txt b/dScripts/02_server/Map/AG/CMakeLists.txt index a8315398e..e13fd26ac 100644 --- a/dScripts/02_server/Map/AG/CMakeLists.txt +++ b/dScripts/02_server/Map/AG/CMakeLists.txt @@ -14,6 +14,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_AG "NpcCowboyServer.cpp" "NpcPirateServer.cpp") -add_library(dScriptsServerMapAG ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG}) +add_library(dScriptsServerMapAG OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG}) target_include_directories(dScriptsServerMapAG PUBLIC ".") target_precompile_headers(dScriptsServerMapAG REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/AG_Spider_Queen/CMakeLists.txt b/dScripts/02_server/Map/AG_Spider_Queen/CMakeLists.txt index 65019afe5..30d09debb 100644 --- a/dScripts/02_server/Map/AG_Spider_Queen/CMakeLists.txt +++ b/dScripts/02_server/Map/AG_Spider_Queen/CMakeLists.txt @@ -2,7 +2,7 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_AG_SPIDER_QUEEN "ZoneAgSpiderQueen.cpp" "SpiderBossTreasureChestServer.cpp") -add_library(dScriptsServerMapAGSpiderQueen ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG_SPIDER_QUEEN}) +add_library(dScriptsServerMapAGSpiderQueen OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG_SPIDER_QUEEN}) target_include_directories(dScriptsServerMapAGSpiderQueen PUBLIC ".") target_link_libraries(dScriptsServerMapAGSpiderQueen dScriptsServerMapProperty) target_precompile_headers(dScriptsServerMapAGSpiderQueen REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/AM/CMakeLists.txt b/dScripts/02_server/Map/AM/CMakeLists.txt index 177b3c455..533fc8105 100644 --- a/dScripts/02_server/Map/AM/CMakeLists.txt +++ b/dScripts/02_server/Map/AM/CMakeLists.txt @@ -17,6 +17,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_AM "AmBlueX.cpp" "AmTeapotServer.cpp") -add_library(dScriptsServerMapAM ${DSCRIPTS_SOURCES_02_SERVER_MAP_AM}) +add_library(dScriptsServerMapAM OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_AM}) target_include_directories(dScriptsServerMapAM PUBLIC ".") target_precompile_headers(dScriptsServerMapAM REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/CMakeLists.txt b/dScripts/02_server/Map/CMakeLists.txt index a5fb5b031..33bd9bd4c 100644 --- a/dScripts/02_server/Map/CMakeLists.txt +++ b/dScripts/02_server/Map/CMakeLists.txt @@ -13,17 +13,33 @@ add_subdirectory(SS) add_subdirectory(VE) add_library(dScriptsServerMap INTERFACE) -target_link_libraries(dScriptsServerMap INTERFACE - dScriptsServerMapAG - dScriptsServerMapAGSpiderQueen - dScriptsServerMapAM - dScriptsServerMapFV - dScriptsServerMapGeneral - dScriptsServerMapGF - dScriptsServerMapNJHub - dScriptsServerMapNS - dScriptsServerMapNT - dScriptsServerMapPR - dScriptsServerMapProperty - dScriptsServerMapSS - dScriptsServerMapVE) +target_sources(dScriptsServerMap INTERFACE + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ +) +target_include_directories(dScriptsServerMap INTERFACE + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ +) diff --git a/dScripts/02_server/Map/FV/CMakeLists.txt b/dScripts/02_server/Map/FV/CMakeLists.txt index 6f774c987..9746a5dd5 100644 --- a/dScripts/02_server/Map/FV/CMakeLists.txt +++ b/dScripts/02_server/Map/FV/CMakeLists.txt @@ -11,6 +11,6 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV_RACING}) set(DSCRIPTS_SOURCES_02_SERVER_MAP_FV ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV} "Racing/${file}") endforeach() -add_library(dScriptsServerMapFV ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV}) +add_library(dScriptsServerMapFV OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV}) target_include_directories(dScriptsServerMapFV PUBLIC "." "Racing") target_precompile_headers(dScriptsServerMapFV REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/GF/CMakeLists.txt b/dScripts/02_server/Map/GF/CMakeLists.txt index 45ec871a3..c6a953006 100644 --- a/dScripts/02_server/Map/GF/CMakeLists.txt +++ b/dScripts/02_server/Map/GF/CMakeLists.txt @@ -4,6 +4,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_GF "MastTeleport.cpp" "SpawnLionServer.cpp") -add_library(dScriptsServerMapGF ${DSCRIPTS_SOURCES_02_SERVER_MAP_GF}) +add_library(dScriptsServerMapGF OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_GF}) target_include_directories(dScriptsServerMapGF PUBLIC ".") target_precompile_headers(dScriptsServerMapGF REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/General/CMakeLists.txt b/dScripts/02_server/Map/General/CMakeLists.txt index 4fe5aae89..3379e5b00 100644 --- a/dScripts/02_server/Map/General/CMakeLists.txt +++ b/dScripts/02_server/Map/General/CMakeLists.txt @@ -27,6 +27,6 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL_NINJAGO}) set(DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL} "Ninjago/${file}") endforeach() -add_library(dScriptsServerMapGeneral ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL}) +add_library(dScriptsServerMapGeneral OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL}) target_include_directories(dScriptsServerMapGeneral PUBLIC "." "Ninjago") target_precompile_headers(dScriptsServerMapGeneral REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/NS/CMakeLists.txt b/dScripts/02_server/Map/NS/CMakeLists.txt index 4927f0c87..6be99dab7 100644 --- a/dScripts/02_server/Map/NS/CMakeLists.txt +++ b/dScripts/02_server/Map/NS/CMakeLists.txt @@ -10,6 +10,6 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS_WAVES}) set(DSCRIPTS_SOURCES_02_SERVER_MAP_NS ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS} "Waves/${file}") endforeach() -add_library(dScriptsServerMapNS ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS}) +add_library(dScriptsServerMapNS OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS}) target_include_directories(dScriptsServerMapNS PUBLIC "." "Waves") target_precompile_headers(dScriptsServerMapNS REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/NT/CMakeLists.txt b/dScripts/02_server/Map/NT/CMakeLists.txt index 49c6a5aea..5ab3307cf 100644 --- a/dScripts/02_server/Map/NT/CMakeLists.txt +++ b/dScripts/02_server/Map/NT/CMakeLists.txt @@ -27,6 +27,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_NT "NtBcSubmitServer.cpp" "NtNaomiBreadcrumbServer.cpp") -add_library(dScriptsServerMapNT ${DSCRIPTS_SOURCES_02_SERVER_MAP_NT}) +add_library(dScriptsServerMapNT OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_NT}) target_include_directories(dScriptsServerMapNT PUBLIC ".") target_precompile_headers(dScriptsServerMapNT REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/PR/CMakeLists.txt b/dScripts/02_server/Map/PR/CMakeLists.txt index 13b3fd35e..8de0e71df 100644 --- a/dScripts/02_server/Map/PR/CMakeLists.txt +++ b/dScripts/02_server/Map/PR/CMakeLists.txt @@ -3,6 +3,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_PR "PrSeagullFly.cpp" "SpawnGryphonServer.cpp") -add_library(dScriptsServerMapPR ${DSCRIPTS_SOURCES_02_SERVER_MAP_PR}) +add_library(dScriptsServerMapPR OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_PR}) target_include_directories(dScriptsServerMapPR PUBLIC ".") target_precompile_headers(dScriptsServerMapPR REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/Property/CMakeLists.txt b/dScripts/02_server/Map/Property/CMakeLists.txt index 52b91d0bf..b4085cfb9 100644 --- a/dScripts/02_server/Map/Property/CMakeLists.txt +++ b/dScripts/02_server/Map/Property/CMakeLists.txt @@ -19,7 +19,7 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY_NS_MED}) set(DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY} "NS_Med/${file}") endforeach() -add_library(dScriptsServerMapProperty ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY}) +add_library(dScriptsServerMapProperty OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY}) target_precompile_headers(dScriptsServerMapProperty REUSE_FROM dScriptsBase) target_include_directories(dScriptsServerMapProperty PUBLIC "." "AG_Med" diff --git a/dScripts/02_server/Map/SS/CMakeLists.txt b/dScripts/02_server/Map/SS/CMakeLists.txt index ed6a7596f..894d4ece5 100644 --- a/dScripts/02_server/Map/SS/CMakeLists.txt +++ b/dScripts/02_server/Map/SS/CMakeLists.txt @@ -1,6 +1,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_SS "SsModularBuildServer.cpp") -add_library(dScriptsServerMapSS ${DSCRIPTS_SOURCES_02_SERVER_MAP_SS}) +add_library(dScriptsServerMapSS OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_SS}) target_include_directories(dScriptsServerMapSS PUBLIC ".") target_precompile_headers(dScriptsServerMapSS REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/VE/CMakeLists.txt b/dScripts/02_server/Map/VE/CMakeLists.txt index 2dbcaaffe..8be55c9f9 100644 --- a/dScripts/02_server/Map/VE/CMakeLists.txt +++ b/dScripts/02_server/Map/VE/CMakeLists.txt @@ -3,6 +3,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_VE "VeEpsilonServer.cpp" "VeBricksampleServer.cpp") -add_library(dScriptsServerMapVE ${DSCRIPTS_SOURCES_02_SERVER_MAP_VE}) +add_library(dScriptsServerMapVE OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_VE}) target_include_directories(dScriptsServerMapVE PUBLIC ".") target_precompile_headers(dScriptsServerMapVE REUSE_FROM dScriptsBase) diff --git a/dScripts/02_server/Map/njhub/CMakeLists.txt b/dScripts/02_server/Map/njhub/CMakeLists.txt index 0f287ce32..94d99867c 100644 --- a/dScripts/02_server/Map/njhub/CMakeLists.txt +++ b/dScripts/02_server/Map/njhub/CMakeLists.txt @@ -28,7 +28,7 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB_BOSS_INSTANCE}) set(DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB} "boss_instance/${file}") endforeach() -add_library(dScriptsServerMapNJHub ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB}) +add_library(dScriptsServerMapNJHub OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB}) target_include_directories(dScriptsServerMapNJHub PUBLIC "." "boss_instance") target_link_libraries(dScriptsServerMapNJHub dScriptsServerPets diff --git a/dScripts/02_server/Pets/CMakeLists.txt b/dScripts/02_server/Pets/CMakeLists.txt index 79123ebec..aa1d0e3f0 100644 --- a/dScripts/02_server/Pets/CMakeLists.txt +++ b/dScripts/02_server/Pets/CMakeLists.txt @@ -3,7 +3,7 @@ set(DSCRIPTS_SOURCES_02_SERVER_PETS "PetFromObjectServer.cpp" "DamagingPets.cpp") -add_library(dScriptsServerPets STATIC ${DSCRIPTS_SOURCES_02_SERVER_PETS}) +add_library(dScriptsServerPets OBJECT ${DSCRIPTS_SOURCES_02_SERVER_PETS}) target_include_directories(dScriptsServerPets PUBLIC ".") target_precompile_headers(dScriptsServerPets REUSE_FROM dScriptsBase) diff --git a/dScripts/CMakeLists.txt b/dScripts/CMakeLists.txt index 2da73eb30..d5290f33e 100644 --- a/dScripts/CMakeLists.txt +++ b/dScripts/CMakeLists.txt @@ -17,9 +17,8 @@ set(DSCRIPTS_SOURCES link_libraries(dDatabase dPhysics) -add_library(dScriptsBase STATIC ${DSCRIPTS_SOURCES}) -target_include_directories(dScriptsBase PUBLIC .) -target_link_libraries(dScriptsBase INTERFACE dGameBase) +add_library(dScriptsBase OBJECT ${DSCRIPTS_SOURCES}) +target_link_libraries(dScriptsBase INTERFACE dGameBase dComponents) target_precompile_headers(dScriptsBase PRIVATE ${HEADERS_DGAME}) include_directories( @@ -34,8 +33,6 @@ include_directories( "${PROJECT_SOURCE_DIR}/dGame/dInventory" # via InventoryComponent.h "${PROJECT_SOURCE_DIR}/dZoneManager" ) -link_libraries(dScriptsBase) -# dComponents add_subdirectory(02_server) add_subdirectory(ai) @@ -44,14 +41,22 @@ add_subdirectory(EquipmentScripts) add_subdirectory(EquipmentTriggers) add_subdirectory(zone) -add_library(dScripts STATIC "CppScripts.cpp") +add_library(dScripts STATIC + $ + $ + $ + $ + $ + "CppScripts.cpp" +) +target_link_libraries(dScripts PRIVATE dScriptsAI dScriptsServer) +target_include_directories(dScripts PRIVATE + $ + $ + $ + $ + $ + $ + $ +) target_precompile_headers(dScripts REUSE_FROM dScriptsBase) -target_include_directories(dScripts PUBLIC ".") -target_link_libraries(dScripts - dScriptsBase - dScriptsServer - dScriptsAI - dScriptsClient - dScriptsEquipmentScripts - dScriptsEquipmentTriggers - dScriptsZone) diff --git a/dScripts/EquipmentScripts/CMakeLists.txt b/dScripts/EquipmentScripts/CMakeLists.txt index 08966e08f..60f315035 100644 --- a/dScripts/EquipmentScripts/CMakeLists.txt +++ b/dScripts/EquipmentScripts/CMakeLists.txt @@ -8,6 +8,6 @@ set(DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS "FireFirstSkillonStartup.cpp" "StunImmunity.cpp") -add_library(dScriptsEquipmentScripts STATIC ${DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS}) +add_library(dScriptsEquipmentScripts OBJECT ${DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS}) target_include_directories(dScriptsEquipmentScripts PUBLIC ".") target_precompile_headers(dScriptsEquipmentScripts REUSE_FROM dScriptsBase) diff --git a/dScripts/EquipmentTriggers/CMakeLists.txt b/dScripts/EquipmentTriggers/CMakeLists.txt index cb6e81a86..af0a1425a 100644 --- a/dScripts/EquipmentTriggers/CMakeLists.txt +++ b/dScripts/EquipmentTriggers/CMakeLists.txt @@ -1,6 +1,6 @@ set(DSCRIPTS_SOURCES_EQUIPMENTTRIGGERSSCRIPTS "CoilBackpackBase.cpp") -add_library(dScriptsEquipmentTriggers STATIC ${DSCRIPTS_SOURCES_EQUIPMENTTRIGGERSSCRIPTS}) +add_library(dScriptsEquipmentTriggers OBJECT ${DSCRIPTS_SOURCES_EQUIPMENTTRIGGERSSCRIPTS}) target_include_directories(dScriptsEquipmentTriggers PUBLIC ".") target_precompile_headers(dScriptsEquipmentTriggers REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/ACT/CMakeLists.txt b/dScripts/ai/ACT/CMakeLists.txt index 5071afa0e..680c5e4cd 100644 --- a/dScripts/ai/ACT/CMakeLists.txt +++ b/dScripts/ai/ACT/CMakeLists.txt @@ -9,6 +9,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_ACT_FOOTRACE}) set(DSCRIPTS_SOURCES_AI_ACT ${DSCRIPTS_SOURCES_AI_ACT} "FootRace/${file}") endforeach() -add_library(dScriptsAiAct STATIC ${DSCRIPTS_SOURCES_AI_ACT}) +add_library(dScriptsAiAct OBJECT ${DSCRIPTS_SOURCES_AI_ACT}) target_include_directories(dScriptsAiAct PUBLIC "." "FootRace") target_precompile_headers(dScriptsAiAct REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/AG/CMakeLists.txt b/dScripts/ai/AG/CMakeLists.txt index e031e386d..e74aac789 100644 --- a/dScripts/ai/AG/CMakeLists.txt +++ b/dScripts/ai/AG/CMakeLists.txt @@ -16,6 +16,6 @@ set(DSCRIPTS_SOURCES_AI_AG "AgStagePlatforms.cpp" "AgQbWall.cpp") -add_library(dScriptsAiAG STATIC ${DSCRIPTS_SOURCES_AI_AG}) +add_library(dScriptsAiAG OBJECT ${DSCRIPTS_SOURCES_AI_AG}) target_include_directories(dScriptsAiAG PUBLIC ".") target_precompile_headers(dScriptsAiAG REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/CMakeLists.txt b/dScripts/ai/CMakeLists.txt index 7e94cd349..354bda21c 100644 --- a/dScripts/ai/CMakeLists.txt +++ b/dScripts/ai/CMakeLists.txt @@ -15,18 +15,34 @@ add_subdirectory(SPEC) add_subdirectory(WILD) add_library(dScriptsAI INTERFACE) -target_link_libraries(dScriptsAI INTERFACE - dScriptsAiAct - dScriptsAiAG - dScriptsAiFV - dScriptsAiGeneral - dScriptsAiGF - dScriptsAiMinigame - dScriptsAiNP - dScriptsAiNS - dScriptsAiPets - dScriptsAiProperty - dScriptsAiRacing - dScriptsAiSpec - dScriptsAiWild +target_sources(dScriptsAI INTERFACE + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ +) + +target_include_directories(dScriptsAI INTERFACE + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ ) diff --git a/dScripts/ai/FV/CMakeLists.txt b/dScripts/ai/FV/CMakeLists.txt index 55c68a270..535a02a66 100644 --- a/dScripts/ai/FV/CMakeLists.txt +++ b/dScripts/ai/FV/CMakeLists.txt @@ -18,7 +18,7 @@ set(DSCRIPTS_SOURCES_AI_FV "FvMaelstromGeyser.cpp" "TriggerGas.cpp") -add_library(dScriptsAiFV STATIC ${DSCRIPTS_SOURCES_AI_FV}) +add_library(dScriptsAiFV OBJECT ${DSCRIPTS_SOURCES_AI_FV}) target_include_directories(dScriptsAiFV PUBLIC ".") target_precompile_headers(dScriptsAiFV REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/GENERAL/CMakeLists.txt b/dScripts/ai/GENERAL/CMakeLists.txt index 9b7f2a2ab..77441b4ac 100644 --- a/dScripts/ai/GENERAL/CMakeLists.txt +++ b/dScripts/ai/GENERAL/CMakeLists.txt @@ -2,7 +2,7 @@ set(DSCRIPTS_SOURCES_AI_GENERAL "InstanceExitTransferPlayerToLastNonInstance.cpp" "LegoDieRoll.cpp") -add_library(dScriptsAiGeneral STATIC ${DSCRIPTS_SOURCES_AI_GENERAL}) +add_library(dScriptsAiGeneral OBJECT ${DSCRIPTS_SOURCES_AI_GENERAL}) target_include_directories(dScriptsAiGeneral PUBLIC ".") target_precompile_headers(dScriptsAiGeneral REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/GF/CMakeLists.txt b/dScripts/ai/GF/CMakeLists.txt index 7a7a17235..d28b04f1b 100644 --- a/dScripts/ai/GF/CMakeLists.txt +++ b/dScripts/ai/GF/CMakeLists.txt @@ -12,6 +12,6 @@ set(DSCRIPTS_SOURCES_AI_GF "PirateRep.cpp" "GfParrotCrash.cpp") -add_library(dScriptsAiGF STATIC ${DSCRIPTS_SOURCES_AI_GF}) +add_library(dScriptsAiGF OBJECT ${DSCRIPTS_SOURCES_AI_GF}) target_include_directories(dScriptsAiGF PUBLIC ".") target_precompile_headers(dScriptsAiGF REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/MINIGAME/CMakeLists.txt b/dScripts/ai/MINIGAME/CMakeLists.txt index 0e07d526a..5598110b1 100644 --- a/dScripts/ai/MINIGAME/CMakeLists.txt +++ b/dScripts/ai/MINIGAME/CMakeLists.txt @@ -12,6 +12,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_MINIGAME_OBJECTS}) set(DSCRIPTS_SOURCES_AI_MINIGAME ${DSCRIPTS_SOURCES_AI_MINIGAME} "Objects/${file}") endforeach() -add_library(dScriptsAiMinigame STATIC ${DSCRIPTS_SOURCES_AI_MINIGAME}) +add_library(dScriptsAiMinigame OBJECT ${DSCRIPTS_SOURCES_AI_MINIGAME}) target_include_directories(dScriptsAiMinigame PUBLIC "." "Objects" "SG_GF" "SG_GF/SERVER") target_precompile_headers(dScriptsAiMinigame REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/NP/CMakeLists.txt b/dScripts/ai/NP/CMakeLists.txt index 9f3f6a651..b71bd1f8b 100644 --- a/dScripts/ai/NP/CMakeLists.txt +++ b/dScripts/ai/NP/CMakeLists.txt @@ -1,6 +1,6 @@ set(DSCRIPTS_SOURCES_AI_NP "NpcNpSpacemanBob.cpp") -add_library(dScriptsAiNP STATIC ${DSCRIPTS_SOURCES_AI_NP}) +add_library(dScriptsAiNP OBJECT ${DSCRIPTS_SOURCES_AI_NP}) target_include_directories(dScriptsAiNP PUBLIC ".") target_precompile_headers(dScriptsAiNP REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/NS/CMakeLists.txt b/dScripts/ai/NS/CMakeLists.txt index 0f0aa0c78..750ee67a9 100644 --- a/dScripts/ai/NS/CMakeLists.txt +++ b/dScripts/ai/NS/CMakeLists.txt @@ -21,7 +21,7 @@ foreach(file ${DSCRIPTS_SOURCES_AI_NS_WH}) set(DSCRIPTS_SOURCES_AI_NS ${DSCRIPTS_SOURCES_AI_NS} "WH/${file}") endforeach() -add_library(dScriptsAiNS STATIC ${DSCRIPTS_SOURCES_AI_NS}) +add_library(dScriptsAiNS OBJECT ${DSCRIPTS_SOURCES_AI_NS}) target_include_directories(dScriptsAiNS PUBLIC "." "NS_PP_01" "WH" PRIVATE ${PROJECT_SOURCE_DIR}/dScripts/02_server/Map/NS) # NsConcertChoiceBuildManager.h diff --git a/dScripts/ai/PETS/CMakeLists.txt b/dScripts/ai/PETS/CMakeLists.txt index 8bd8630c3..b7ae20334 100644 --- a/dScripts/ai/PETS/CMakeLists.txt +++ b/dScripts/ai/PETS/CMakeLists.txt @@ -1,6 +1,6 @@ set(DSCRIPTS_SOURCES_AI_PETS "HydrantSmashable.cpp") -add_library(dScriptsAiPets STATIC ${DSCRIPTS_SOURCES_AI_PETS}) +add_library(dScriptsAiPets OBJECT ${DSCRIPTS_SOURCES_AI_PETS}) target_include_directories(dScriptsAiPets PUBLIC "." "NS_PP_01" "WH") target_precompile_headers(dScriptsAiPets REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/PROPERTY/CMakeLists.txt b/dScripts/ai/PROPERTY/CMakeLists.txt index a31b9257e..07c528f72 100644 --- a/dScripts/ai/PROPERTY/CMakeLists.txt +++ b/dScripts/ai/PROPERTY/CMakeLists.txt @@ -8,6 +8,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_PROPERTY_AG}) set(DSCRIPTS_SOURCES_AI_PROPERTY ${DSCRIPTS_SOURCES_AI_PROPERTY} "AG/${file}") endforeach() -add_library(dScriptsAiProperty STATIC ${DSCRIPTS_SOURCES_AI_PROPERTY}) +add_library(dScriptsAiProperty OBJECT ${DSCRIPTS_SOURCES_AI_PROPERTY}) target_include_directories(dScriptsAiProperty PUBLIC "." "AG") target_precompile_headers(dScriptsAiProperty REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/RACING/CMakeLists.txt b/dScripts/ai/RACING/CMakeLists.txt index b7343c61b..a803b051c 100644 --- a/dScripts/ai/RACING/CMakeLists.txt +++ b/dScripts/ai/RACING/CMakeLists.txt @@ -6,6 +6,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_RACING_OBJECTS}) set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "OBJECTS/${file}") endforeach() -add_library(dScriptsAiRacing STATIC ${DSCRIPTS_SOURCES_AI_RACING}) +add_library(dScriptsAiRacing OBJECT ${DSCRIPTS_SOURCES_AI_RACING}) target_include_directories(dScriptsAiRacing PUBLIC "." "OBJECTS") target_precompile_headers(dScriptsAiRacing REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/SPEC/CMakeLists.txt b/dScripts/ai/SPEC/CMakeLists.txt index c60372ac1..29a781eb2 100644 --- a/dScripts/ai/SPEC/CMakeLists.txt +++ b/dScripts/ai/SPEC/CMakeLists.txt @@ -3,6 +3,6 @@ set(DSCRIPTS_SOURCES_AI_SPEC "SpecialPowerupSpawner.cpp" "SpecialSpeedBuffSpawner.cpp") -add_library(dScriptsAiSpec STATIC ${DSCRIPTS_SOURCES_AI_SPEC}) +add_library(dScriptsAiSpec OBJECT ${DSCRIPTS_SOURCES_AI_SPEC}) target_include_directories(dScriptsAiSpec PUBLIC ".") target_precompile_headers(dScriptsAiSpec REUSE_FROM dScriptsBase) diff --git a/dScripts/ai/WILD/CMakeLists.txt b/dScripts/ai/WILD/CMakeLists.txt index 418ffb5f4..cc5318ffe 100644 --- a/dScripts/ai/WILD/CMakeLists.txt +++ b/dScripts/ai/WILD/CMakeLists.txt @@ -9,6 +9,6 @@ set(DSCRIPTS_SOURCES_AI_WILD "WildNinjaSensei.cpp" "WildPants.cpp") -add_library(dScriptsAiWild STATIC ${DSCRIPTS_SOURCES_AI_WILD}) +add_library(dScriptsAiWild OBJECT ${DSCRIPTS_SOURCES_AI_WILD}) target_include_directories(dScriptsAiWild PUBLIC ".") target_precompile_headers(dScriptsAiWild REUSE_FROM dScriptsBase) diff --git a/dScripts/client/CMakeLists.txt b/dScripts/client/CMakeLists.txt index b3ad08fbd..f6760006b 100644 --- a/dScripts/client/CMakeLists.txt +++ b/dScripts/client/CMakeLists.txt @@ -6,6 +6,6 @@ foreach(file ${DSCRIPTS_SOURCES_CLIENT_AI}) set(DSCRIPTS_SOURCES_CLIENT ${DSCRIPTS_SOURCES_CLIENT} "ai/${file}") endforeach() -add_library(dScriptsClient STATIC ${DSCRIPTS_SOURCES_CLIENT}) +add_library(dScriptsClient OBJECT ${DSCRIPTS_SOURCES_CLIENT}) target_include_directories(dScriptsClient PUBLIC "." "ai" "ai/PR") target_precompile_headers(dScriptsClient REUSE_FROM dScriptsBase) diff --git a/dScripts/zone/CMakeLists.txt b/dScripts/zone/CMakeLists.txt index 93ea70ca7..e87688f43 100644 --- a/dScripts/zone/CMakeLists.txt +++ b/dScripts/zone/CMakeLists.txt @@ -18,7 +18,7 @@ foreach(file ${DSCRIPTS_SOURCES_ZONE_PROPERTY}) set(DSCRIPTS_SOURCES_ZONE ${DSCRIPTS_SOURCES_ZONE} "PROPERTY/${file}") endforeach() -add_library(dScriptsZone STATIC ${DSCRIPTS_SOURCES_ZONE}) +add_library(dScriptsZone OBJECT ${DSCRIPTS_SOURCES_ZONE}) target_include_directories(dScriptsZone PUBLIC "." "AG" "LUPs" diff --git a/dWorldServer/CMakeLists.txt b/dWorldServer/CMakeLists.txt index 2deb06350..85a26ed9b 100644 --- a/dWorldServer/CMakeLists.txt +++ b/dWorldServer/CMakeLists.txt @@ -2,10 +2,17 @@ set(DWORLDSERVER_SOURCES "PerformanceManager.cpp" ) -add_library(dWorldServer ${DWORLDSERVER_SOURCES}) -target_link_libraries(dWorldServer PRIVATE dGame) # ${COMMON_LIBRARIES} +add_library(dWorldServer OBJECT ${DWORLDSERVER_SOURCES}) +target_link_libraries(dWorldServer PUBLIC dGameBase dCommon) add_executable(WorldServer "WorldServer.cpp") add_compile_definitions(WorldServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") -target_link_libraries(WorldServer ${COMMON_LIBRARIES} dGame dChatFilter dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dNavigation) \ No newline at end of file +target_link_libraries(WorldServer ${COMMON_LIBRARIES} + dScripts + dGameBase + dComponents + dUtilities + dGameMessages + dInventory + dGame dChatFilter dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dNavigation) \ No newline at end of file diff --git a/dZoneManager/CMakeLists.txt b/dZoneManager/CMakeLists.txt index 0b2f5252f..ba860e0f6 100644 --- a/dZoneManager/CMakeLists.txt +++ b/dZoneManager/CMakeLists.txt @@ -3,11 +3,13 @@ set(DZONEMANAGER_SOURCES "dZoneManager.cpp" "Spawner.cpp" "Zone.cpp") -add_library(dZoneManager STATIC ${DZONEMANAGER_SOURCES}) +add_library(dZoneManager OBJECT ${DZONEMANAGER_SOURCES}) target_link_libraries(dZoneManager PRIVATE dDatabaseCDClient - PUBLIC dPhysics - INTERFACE dWorldServer) + PUBLIC dPhysics) + +#set_property(TARGET dZoneManager APPEND PROPERTY INTERFACE_LINK_LIBRARIES dWorldServer) + target_include_directories(dZoneManager PUBLIC "." ${PROJECT_SOURCE_DIR}/dGame # Entity.h ${PROJECT_SOURCE_DIR}/dGame/dEntity # EntityInfo.h diff --git a/tests/dGameTests/CMakeLists.txt b/tests/dGameTests/CMakeLists.txt index b1fdaa070..9a76bc82c 100644 --- a/tests/dGameTests/CMakeLists.txt +++ b/tests/dGameTests/CMakeLists.txt @@ -13,7 +13,8 @@ file(COPY ${GAMEMESSAGE_TESTBITSTREAMS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) # Add the executable. Remember to add all tests above this! add_executable(dGameTests ${DGAMETEST_SOURCES}) -target_link_libraries(dGameTests ${COMMON_LIBRARIES} GTest::gtest_main dGame dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dChatFilter dNavigation) +target_link_libraries(dGameTests ${COMMON_LIBRARIES} GTest::gtest_main + dGame dScripts dPhysics Detour Recast tinyxml2 dWorldServer dZoneManager dChatFilter dNavigation) # Discover the tests gtest_discover_tests(dGameTests) From d6d5cb7515ab82b79a911ba1512222d525e32398 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Thu, 4 Jan 2024 03:20:06 +0100 Subject: [PATCH 06/26] fix: rebase --- dGame/CMakeLists.txt | 1 + dGame/dComponents/CMakeLists.txt | 2 ++ dNet/CMakeLists.txt | 2 +- dScripts/02_server/CMakeLists.txt | 1 - 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dGame/CMakeLists.txt b/dGame/CMakeLists.txt index b40d4e531..76af2e7e0 100644 --- a/dGame/CMakeLists.txt +++ b/dGame/CMakeLists.txt @@ -17,6 +17,7 @@ add_library(dGameBase OBJECT ${DGAME_SOURCES}) target_precompile_headers(dGameBase PRIVATE ${HEADERS_DGAME}) target_include_directories(dGameBase PUBLIC "." "dEntity" PRIVATE "dComponents" "dGameMessages" "dBehaviors" "dMission" "dUtilities" "dInventory" + $ "${PROJECT_SOURCE_DIR}/dCommon" "${PROJECT_SOURCE_DIR}/dCommon/dEnums" "${PROJECT_SOURCE_DIR}/dCommon/dClient" diff --git a/dGame/dComponents/CMakeLists.txt b/dGame/dComponents/CMakeLists.txt index 4b691154e..c9f0177c9 100644 --- a/dGame/dComponents/CMakeLists.txt +++ b/dGame/dComponents/CMakeLists.txt @@ -51,6 +51,8 @@ set(DGAME_DCOMPONENTS_SOURCES add_library(dComponents OBJECT ${DGAME_DCOMPONENTS_SOURCES}) target_include_directories(dComponents PUBLIC "." + "${PROJECT_SOURCE_DIR}/dGame/dPropertyBehaviors" # via ModelComponent.h + "${PROJECT_SOURCE_DIR}/dGame/dPropertyBehaviors/ControlBehaviorMessages" "${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h "${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h "${PROJECT_SOURCE_DIR}/dGame/dInventory" # via InventoryComponent.h diff --git a/dNet/CMakeLists.txt b/dNet/CMakeLists.txt index f3f57ba48..8717da795 100644 --- a/dNet/CMakeLists.txt +++ b/dNet/CMakeLists.txt @@ -13,7 +13,7 @@ target_include_directories(dNet PRIVATE ${PROJECT_SOURCE_DIR}/dCommon/dEnums ${PROJECT_SOURCE_DIR}/dZoneManager - + ${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase ${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/CDClientTables ${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase diff --git a/dScripts/02_server/CMakeLists.txt b/dScripts/02_server/CMakeLists.txt index 53a8ee467..8114b2267 100644 --- a/dScripts/02_server/CMakeLists.txt +++ b/dScripts/02_server/CMakeLists.txt @@ -55,4 +55,3 @@ target_include_directories(dScriptsServer INTERFACE $ $ ) - From 2ad3cb79d341ab15ea3eb0ebd69b20afc2698c74 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Thu, 4 Jan 2024 21:44:17 +0100 Subject: [PATCH 07/26] fix: bcrypt --- CMakeLists.txt | 6 ------ dMasterServer/CMakeLists.txt | 2 +- dNet/CMakeLists.txt | 1 + thirdparty/CMakeLists.txt | 6 +++++- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d857670b2..342e17b93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,12 +245,6 @@ foreach(dir ${INCLUDED_DIRECTORIES}) include_directories(${PROJECT_SOURCE_DIR}/${dir}) endforeach() -if(NOT WIN32) - include_directories("${PROJECT_SOURCE_DIR}/thirdparty/libbcrypt/include/bcrypt") -endif() - -include_directories("${PROJECT_SOURCE_DIR}/thirdparty/libbcrypt/include") - # Add linking directories: # link_directories(${PROJECT_BINARY_DIR}) diff --git a/dMasterServer/CMakeLists.txt b/dMasterServer/CMakeLists.txt index 281c9f24b..f29e1eb49 100644 --- a/dMasterServer/CMakeLists.txt +++ b/dMasterServer/CMakeLists.txt @@ -11,7 +11,7 @@ target_include_directories(dMasterServer PUBLIC "." "${PROJECT_SOURCE_DIR}/dZoneManager" # InstanceManager.h uses dZMCommon.h ) target_link_libraries(dMasterServer ${COMMON_LIBRARIES}) -target_link_libraries(MasterServer ${COMMON_LIBRARIES} dMasterServer) +target_link_libraries(MasterServer ${COMMON_LIBRARIES} bcrypt dMasterServer) if(WIN32) add_dependencies(MasterServer WorldServer AuthServer ChatServer) diff --git a/dNet/CMakeLists.txt b/dNet/CMakeLists.txt index 8717da795..45f1cdbf9 100644 --- a/dNet/CMakeLists.txt +++ b/dNet/CMakeLists.txt @@ -8,6 +8,7 @@ set(DNET_SOURCES "AuthPackets.cpp" "ZoneInstanceManager.cpp") add_library(dNet STATIC ${DNET_SOURCES}) +target_link_libraries(dNet PRIVATE bcrypt) target_include_directories(dNet PRIVATE ${PROJECT_SOURCE_DIR}/dCommon ${PROJECT_SOURCE_DIR}/dCommon/dEnums diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 12667df82..0d292936e 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -19,7 +19,11 @@ add_library(bcrypt ${SOURCES_LIBBCRYPT}) # Because we are not using the libbcrypt CMakeLists.txt, we need to include these headers for the library to use. # fortunately they are only needed for building the libbcrypt directory and nothing else, so these are marked private. -target_include_directories(bcrypt PRIVATE "libbcrypt/include/bcrypt") +if(NOT WIN32) + target_include_directories(bcrypt PRIVATE "libbcrypt/include/bcrypt") +endif() + +target_include_directories(bcrypt INTERFACE "libbcrypt/include") target_include_directories(bcrypt PRIVATE "libbcrypt/src") # Source code for sqlite From a166e3ef3f48a0f2f9f1c90cf98acc00d37aa11b Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 00:21:47 +0100 Subject: [PATCH 08/26] wip: try simplified connector build --- thirdparty/CMakeMariaDBLists.txt | 62 ++++++++++---------------------- 1 file changed, 19 insertions(+), 43 deletions(-) diff --git a/thirdparty/CMakeMariaDBLists.txt b/thirdparty/CMakeMariaDBLists.txt index d7a17f28c..42391531b 100644 --- a/thirdparty/CMakeMariaDBLists.txt +++ b/thirdparty/CMakeMariaDBLists.txt @@ -85,62 +85,38 @@ else() # Build from source -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0) endif() + set(MARIADBCPP_INSTALL_DIR ${PROJECT_BINARY_DIR}/prefix) + set(MARIADBCPP_LIBRARY_DIR ${PROJECT_BINARY_DIR}/mariadbcpp) + set(MARIADBCPP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mariadb-connector-cpp) ExternalProject_Add(mariadb_connector_cpp - SOURCE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/mariadb-connector-cpp - CMAKE_ARGS -Wno-dev - -DCMAKE_BUILD_RPATH_USE_ORIGIN=${CMAKE_BUILD_RPATH_USE_ORIGIN} - -DCMAKE_INSTALL_PREFIX=./mariadbcpp # Points the connector to the correct plugin directory - -DINSTALL_PLUGINDIR=plugin - ${MARIADB_EXTRA_CMAKE_ARGS} - PREFIX "${PROJECT_BINARY_DIR}/mariadbcpp" - BUILD_COMMAND cmake --build . --config RelWithDebInfo -j${MARIADB_CONNECTOR_COMPILE_JOBS} - INSTALL_COMMAND "") - - ExternalProject_Get_Property(mariadb_connector_cpp BINARY_DIR) + PREFIX "${PROJECT_BINARY_DIR}/mariadbcpp-build" + SOURCE_DIR ${MARIADBCPP_SOURCE_DIR} + INSTALL_DIR ${MARIADBCPP_INSTALL_DIR} + CMAKE_ARGS -Wno-dev + -DCMAKE_BUILD_RPATH_USE_ORIGIN=${CMAKE_BUILD_RPATH_USE_ORIGIN} + -DCMAKE_INSTALL_PREFIX= + -DINSTALL_LIBDIR=${MARIADBCPP_LIBRARY_DIR} + -DINSTALL_PLUGINDIR=${MARIADBCPP_LIBRARY_DIR}/plugin + ${MARIADB_EXTRA_CMAKE_ARGS} + BUILD_ALWAYS true + ) if(WIN32) set(MARIADB_SHARED_LIBRARY_NAME mariadbcpp.dll) set(MARIADB_PLUGIN_SUFFIX .dll) - set(MARIADB_IMPLIB_LOCATION "${BINARY_DIR}/RelWithDebInfo/mariadbcpp.lib") + set(MARIADB_IMPLIB_LOCATION "${MARIADBCPP_INSTALL_DIR}/mariadbcpp.lib") # When built from source windows only seems to check same folder as exe instead specified folder, so use # environment variable to force it add_link_options(/DELAYLOAD:mariadbcpp.dll) - add_compile_definitions(MARIADB_PLUGIN_DIR_OVERRIDE="${PROJECT_BINARY_DIR}/mariadbcpp/plugin") + add_compile_definitions(MARIADB_PLUGIN_DIR_OVERRIDE="${MARIADBCPP_LIBRARY_DIR}/plugin") else() set(MARIADB_SHARED_LIBRARY_NAME libmariadbcpp${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(MARIADB_PLUGIN_SUFFIX .so) + set(MARIADB_PLUGIN_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) endif() - get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) - if(isMultiConfig) - set(MARIADB_SHARED_LIBRARY_LOCATION "${BINARY_DIR}/RelWithDebInfo/${MARIADB_SHARED_LIBRARY_NAME}") - set(MARIADB_SHARED_LIBRARY_COPY_LOCATION "${PROJECT_BINARY_DIR}/$") - set(MARIADB_PLUGINS_LOCATION "${BINARY_DIR}/libmariadb/RelWithDebInfo") - else() - set(MARIADB_SHARED_LIBRARY_LOCATION "${BINARY_DIR}/${MARIADB_SHARED_LIBRARY_NAME}") - set(MARIADB_SHARED_LIBRARY_COPY_LOCATION "${PROJECT_BINARY_DIR}") - set(MARIADB_PLUGINS_LOCATION "${BINARY_DIR}/libmariadb") - endif() - - set(MARIADB_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/thirdparty/mariadb-connector-cpp/include/") - - add_custom_command(TARGET mariadb_connector_cpp POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory - ${BINARY_DIR}/mariadbcpp/plugin - ${MARIADB_SHARED_LIBRARY_COPY_LOCATION} - - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${MARIADB_SHARED_LIBRARY_LOCATION} - ${MARIADB_SHARED_LIBRARY_COPY_LOCATION} - - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${MARIADB_PLUGINS_LOCATION}/caching_sha2_password${MARIADB_PLUGIN_SUFFIX} - ${MARIADB_PLUGINS_LOCATION}/client_ed25519${MARIADB_PLUGIN_SUFFIX} - ${MARIADB_PLUGINS_LOCATION}/dialog${MARIADB_PLUGIN_SUFFIX} - ${MARIADB_PLUGINS_LOCATION}/mysql_clear_password${MARIADB_PLUGIN_SUFFIX} - ${MARIADB_PLUGINS_LOCATION}/sha256_password${MARIADB_PLUGIN_SUFFIX} - ${BINARY_DIR}/mariadbcpp/plugin) + set(MARIADB_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/${MARIADB_SHARED_LIBRARY_NAME}") + set(MARIADB_INCLUDE_DIR "${MARIADBCPP_SOURCE_DIR}/include") endif() # Remove the CMakeLists.txt file from the tests folder for the maria-db-connector so we dont compile the tests. From 259067c64ae95f718dec33c620807ea8cec86218 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 00:23:12 +0100 Subject: [PATCH 09/26] fix: update dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c1316a60f..caf4c49fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,8 @@ RUN --mount=type=cache,id=build-apt-cache,target=/var/cache/apt \ rm -rf /var/lib/apt/lists/* # Grab libraries and load them -COPY --from=build /app/build/mariadbcpp/src/mariadb_connector_cpp-build/libmariadbcpp.so /usr/local/lib/ -COPY --from=build /app/build/mariadbcpp/src/mariadb_connector_cpp-build/libmariadb/libmariadb/libmariadb.so.3 /usr/local/lib +COPY --from=build /app/build/mariadbcpp/libmariadbcpp.so /usr/local/lib/ +COPY --from=build /app/build/mariadbcpp/libmariadb.so.3 /usr/local/lib/ RUN ldconfig # Server bins From 17305831a162fcf037c3b910a3a3767a3aaca6d6 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 09:43:10 +0100 Subject: [PATCH 10/26] fix: mariadb C/C++ on apple --- thirdparty/CMakeMariaDBLists.txt | 18 ++++++++---------- thirdparty/mariadb-connector-cpp | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/thirdparty/CMakeMariaDBLists.txt b/thirdparty/CMakeMariaDBLists.txt index 42391531b..286185f06 100644 --- a/thirdparty/CMakeMariaDBLists.txt +++ b/thirdparty/CMakeMariaDBLists.txt @@ -86,17 +86,21 @@ else() # Build from source endif() set(MARIADBCPP_INSTALL_DIR ${PROJECT_BINARY_DIR}/prefix) + message("MariaDB C/C++ install prefix: " ${MARIADBCPP_INSTALL_DIR}) set(MARIADBCPP_LIBRARY_DIR ${PROJECT_BINARY_DIR}/mariadbcpp) + set(MARIADBCPP_PLUGIN_DIR ${MARIADBCPP_LIBRARY_DIR}/plugin) set(MARIADBCPP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mariadb-connector-cpp) + set(MARIADB_INCLUDE_DIR "${MARIADBCPP_SOURCE_DIR}/include") ExternalProject_Add(mariadb_connector_cpp - PREFIX "${PROJECT_BINARY_DIR}/mariadbcpp-build" + PREFIX "${PROJECT_BINARY_DIR}/thirdparty/mariadb-connector-cpp" SOURCE_DIR ${MARIADBCPP_SOURCE_DIR} INSTALL_DIR ${MARIADBCPP_INSTALL_DIR} CMAKE_ARGS -Wno-dev + -DWITH_UNIT_TESTS=OFF -DCMAKE_BUILD_RPATH_USE_ORIGIN=${CMAKE_BUILD_RPATH_USE_ORIGIN} -DCMAKE_INSTALL_PREFIX= -DINSTALL_LIBDIR=${MARIADBCPP_LIBRARY_DIR} - -DINSTALL_PLUGINDIR=${MARIADBCPP_LIBRARY_DIR}/plugin + -DINSTALL_PLUGINDIR=${MARIADBCPP_PLUGIN_DIR} ${MARIADB_EXTRA_CMAKE_ARGS} BUILD_ALWAYS true ) @@ -104,24 +108,18 @@ else() # Build from source if(WIN32) set(MARIADB_SHARED_LIBRARY_NAME mariadbcpp.dll) set(MARIADB_PLUGIN_SUFFIX .dll) - set(MARIADB_IMPLIB_LOCATION "${MARIADBCPP_INSTALL_DIR}/mariadbcpp.lib") + set(MARIADB_IMPLIB_LOCATION "${MARIADBCPP_LIBRARY_DIR}/mariadbcpp.lib") # When built from source windows only seems to check same folder as exe instead specified folder, so use # environment variable to force it add_link_options(/DELAYLOAD:mariadbcpp.dll) - add_compile_definitions(MARIADB_PLUGIN_DIR_OVERRIDE="${MARIADBCPP_LIBRARY_DIR}/plugin") + add_compile_definitions(MARIADB_PLUGIN_DIR_OVERRIDE="${MARIADBCPP_PLUGIN_DIR}") else() set(MARIADB_SHARED_LIBRARY_NAME libmariadbcpp${CMAKE_SHARED_LIBRARY_SUFFIX}) set(MARIADB_PLUGIN_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) endif() set(MARIADB_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/${MARIADB_SHARED_LIBRARY_NAME}") - set(MARIADB_INCLUDE_DIR "${MARIADBCPP_SOURCE_DIR}/include") -endif() - -# Remove the CMakeLists.txt file from the tests folder for the maria-db-connector so we dont compile the tests. -if(EXISTS "${CMAKE_SOURCE_DIR}/thirdparty/mariadb-connector-cpp/test/CMakeLists.txt") - file(REMOVE "${CMAKE_SOURCE_DIR}/thirdparty/mariadb-connector-cpp/test/CMakeLists.txt") endif() # Create mariadb connector library object diff --git a/thirdparty/mariadb-connector-cpp b/thirdparty/mariadb-connector-cpp index 8641b1453..ef0873998 160000 --- a/thirdparty/mariadb-connector-cpp +++ b/thirdparty/mariadb-connector-cpp @@ -1 +1 @@ -Subproject commit 8641b1453ae3ce5a70f78248a1f7fc20a048cb88 +Subproject commit ef0873998b3f94a4f76a485fb90b14866fbb99d4 From cb065a07afd916b64a617731560d42ccf601e013 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 20:10:48 +0100 Subject: [PATCH 11/26] feat: Move scripts to CMAKE_MODULE_PATH --- CMakeLists.txt | 4 ++- cmake/FindGoogleTest.cmake | 17 ++++++++++ .../FindMariaDB.cmake | 33 ++++++++++++------- dDatabase/GameDatabase/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 16 ++------- thirdparty/CMakeLists.txt | 3 -- 6 files changed, 46 insertions(+), 29 deletions(-) create mode 100644 cmake/FindGoogleTest.cmake rename thirdparty/CMakeMariaDBLists.txt => cmake/FindMariaDB.cmake (81%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 342e17b93..b42ddc6c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +find_package(MariaDB) + # Create a /resServer directory make_directory(${CMAKE_BINARY_DIR}/resServer) @@ -281,7 +283,7 @@ add_subdirectory(dNavigation) add_subdirectory(dPhysics) # Create a list of common libraries shared between all binaries -set(COMMON_LIBRARIES "dCommon" "dDatabase" "dNet" "raknet" "mariadbConnCpp" "magic_enum") +set(COMMON_LIBRARIES "dCommon" "dDatabase" "dNet" "raknet" "MariaDB::ConnCpp" "magic_enum") # Add platform specific common libraries if(UNIX) diff --git a/cmake/FindGoogleTest.cmake b/cmake/FindGoogleTest.cmake new file mode 100644 index 000000000..69d16247a --- /dev/null +++ b/cmake/FindGoogleTest.cmake @@ -0,0 +1,17 @@ +include(FetchContent) + +message(STATUS "Fetching gtest...") + +FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG release-1.12.1 +) + +# For Windows: Prevent overriding the parent project's compiler/linker settings +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + +FetchContent_MakeAvailable(GoogleTest) + +message(STATUS "gtest fetched and is now ready.") +set(GoogleTest_FOUND TRUE) diff --git a/thirdparty/CMakeMariaDBLists.txt b/cmake/FindMariaDB.cmake similarity index 81% rename from thirdparty/CMakeMariaDBLists.txt rename to cmake/FindMariaDB.cmake index 286185f06..d9c4a8827 100644 --- a/thirdparty/CMakeMariaDBLists.txt +++ b/cmake/FindMariaDB.cmake @@ -43,27 +43,28 @@ if(WIN32 AND NOT MARIADB_BUILD_SOURCE) file(TO_NATIVE_PATH "${MARIADB_MSI_DIR}/${MARIADB_CONNECTOR_C_MSI}" MSI_DIR) execute_process(COMMAND msiexec /a ${MSI_DIR} /qn TARGETDIR=${MSIEXEC_TARGETDIR}) endif() + set(MARIADBC_SHARED_LIBRARY_LOCATION "${MARIADB_C_CONNECTOR_DIR}/lib/libmariadb.dll") if(NOT EXISTS "${MARIADB_CPP_CONNECTOR_DIR}") file(TO_NATIVE_PATH "${MARIADB_MSI_DIR}/${MARIADB_CONNECTOR_CPP_MSI}" MSI_DIR) execute_process(COMMAND msiexec /a ${MSI_DIR} /qn TARGETDIR=${MSIEXEC_TARGETDIR}) endif() - set(MARIADB_SHARED_LIBRARY_LOCATION "${MARIADB_CPP_CONNECTOR_DIR}/mariadbcpp.dll") + set(MARIADBCPP_SHARED_LIBRARY_LOCATION "${MARIADB_CPP_CONNECTOR_DIR}/mariadbcpp.dll") set(MARIADB_IMPLIB_LOCATION "${MARIADB_CPP_CONNECTOR_DIR}/mariadbcpp.lib") set(MARIADB_INCLUDE_DIR "${MARIADB_CPP_CONNECTOR_DIR}/include/mariadb") add_custom_target(mariadb_connector_cpp) add_custom_command(TARGET mariadb_connector_cpp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${MARIADB_CPP_CONNECTOR_DIR}/mariadbcpp.dll" - "${MARIADB_C_CONNECTOR_DIR}/lib/libmariadb.dll" + "${MARIADBCPP_SHARED_LIBRARY_LOCATION}" + "${MARIADBC_SHARED_LIBRARY_LOCATION}" "${PROJECT_BINARY_DIR}") # MariaDB uses plugins that the database needs to load, the prebuilt binaries by default will try to find the libraries in system directories, # so set this define and the servers will set the MARIADB_PLUGIN_DIR environment variable to the appropriate directory. # Plugin directory is determined at dll load time (this will happen before main()) so we need to delay the dll load so that we can set the environment variable - add_link_options(/DELAYLOAD:${MARIADB_SHARED_LIBRARY_LOCATION}) + add_link_options(/DELAYLOAD:${MARIADBCPP_SHARED_LIBRARY_LOCATION}) add_compile_definitions(MARIADB_PLUGIN_DIR_OVERRIDE="${MARIADB_CPP_CONNECTOR_DIR}/plugin") else() # Build from source @@ -89,7 +90,7 @@ else() # Build from source message("MariaDB C/C++ install prefix: " ${MARIADBCPP_INSTALL_DIR}) set(MARIADBCPP_LIBRARY_DIR ${PROJECT_BINARY_DIR}/mariadbcpp) set(MARIADBCPP_PLUGIN_DIR ${MARIADBCPP_LIBRARY_DIR}/plugin) - set(MARIADBCPP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mariadb-connector-cpp) + set(MARIADBCPP_SOURCE_DIR ${PROJECT_SOURCE_DIR}/thirdparty/mariadb-connector-cpp) set(MARIADB_INCLUDE_DIR "${MARIADBCPP_SOURCE_DIR}/include") ExternalProject_Add(mariadb_connector_cpp PREFIX "${PROJECT_BINARY_DIR}/thirdparty/mariadb-connector-cpp" @@ -97,6 +98,7 @@ else() # Build from source INSTALL_DIR ${MARIADBCPP_INSTALL_DIR} CMAKE_ARGS -Wno-dev -DWITH_UNIT_TESTS=OFF + -DMARIADB_LINK_DYNAMIC=OFF -DCMAKE_BUILD_RPATH_USE_ORIGIN=${CMAKE_BUILD_RPATH_USE_ORIGIN} -DCMAKE_INSTALL_PREFIX= -DINSTALL_LIBDIR=${MARIADBCPP_LIBRARY_DIR} @@ -119,17 +121,26 @@ else() # Build from source set(MARIADB_PLUGIN_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) endif() - set(MARIADB_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/${MARIADB_SHARED_LIBRARY_NAME}") + set(MARIADBCPP_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/${MARIADB_SHARED_LIBRARY_NAME}") + if(WIN32) + set(MARIADBC_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/libmariadb.lib") + #elseif(UNIX) + # set(MARIADBC_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/libmariadb.so.3") + endif() endif() # Create mariadb connector library object -add_library(mariadbConnCpp SHARED IMPORTED GLOBAL) -set_property(TARGET mariadbConnCpp PROPERTY IMPORTED_LOCATION ${MARIADB_SHARED_LIBRARY_LOCATION}) +message("libmariadb: ${MARIADBC_SHARED_LIBRARY_LOCATION}") +message("libmariadbcpp: ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") +add_library(MariaDB::ConnCpp SHARED IMPORTED GLOBAL) +add_dependencies(MariaDB::ConnCpp mariadb_connector_cpp) +set_property(TARGET MariaDB::ConnCpp PROPERTY IMPORTED_LOCATION ${MARIADBCPP_SHARED_LIBRARY_LOCATION}) if(WIN32) - set_property(TARGET mariadbConnCpp PROPERTY IMPORTED_IMPLIB ${MARIADB_IMPLIB_LOCATION}) + set_property(TARGET MariaDB::ConnCpp PROPERTY IMPORTED_IMPLIB ${MARIADB_IMPLIB_LOCATION}) endif() # Add directories to include lists -target_include_directories(mariadbConnCpp INTERFACE ${MARIADB_INCLUDE_DIR}) -add_dependencies(mariadbConnCpp mariadb_connector_cpp) +target_include_directories(MariaDB::ConnCpp INTERFACE ${MARIADB_INCLUDE_DIR}) + +set(MariaDB_FOUND TRUE) diff --git a/dDatabase/GameDatabase/CMakeLists.txt b/dDatabase/GameDatabase/CMakeLists.txt index 8805b267a..09ca7251e 100644 --- a/dDatabase/GameDatabase/CMakeLists.txt +++ b/dDatabase/GameDatabase/CMakeLists.txt @@ -15,7 +15,7 @@ target_include_directories(dDatabaseGame PUBLIC "." "${PROJECT_SOURCE_DIR}/dCommon/dEnums" ) target_link_libraries(dDatabaseGame - PUBLIC mariadbConnCpp + PUBLIC MariaDB::ConnCpp INTERFACE dCommon) # Glob together all headers that need to be precompiled diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9ba75a2f1..ec5498487 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,20 +1,10 @@ -message (STATUS "Testing is enabled. Fetching gtest...") +message (STATUS "Testing is enabled.") enable_testing() -include(FetchContent) -FetchContent_Declare( - googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG release-1.12.1 -) - -# For Windows: Prevent overriding the parent project's compiler/linker settings -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - -FetchContent_MakeAvailable(GoogleTest) +find_package(GoogleTest REQUIRED) include(GoogleTest) -message(STATUS "gtest fetched and is now ready.") +unset(CMAKE_RUNTIME_OUTPUT_DIRECTORY) # for now # Add the subdirectories add_subdirectory(dCommonTests) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 0d292936e..2468b148f 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -32,9 +32,6 @@ add_subdirectory(SQLite) # Source code for magic_enum add_subdirectory(magic_enum) -# MariaDB C++ Connector -include(CMakeMariaDBLists.txt) - # Create our third party library objects add_subdirectory(raknet) From 6fb88e79a03bd100e4a883bcb8f6469533776944 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 20:28:18 +0100 Subject: [PATCH 12/26] fix: dPropertyBehaviors --- dGame/dPropertyBehaviors/CMakeLists.txt | 1 + tests/dCommonTests/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dGame/dPropertyBehaviors/CMakeLists.txt b/dGame/dPropertyBehaviors/CMakeLists.txt index e3984086c..3e03ba1d1 100644 --- a/dGame/dPropertyBehaviors/CMakeLists.txt +++ b/dGame/dPropertyBehaviors/CMakeLists.txt @@ -17,6 +17,7 @@ target_link_libraries(dPropertyBehaviors PRIVATE dDatabaseCDClient) target_include_directories(dPropertyBehaviors PUBLIC "." "ControlBehaviorMessages" PRIVATE "${PROJECT_SOURCE_DIR}/dCommon/dClient" # ControlBehaviors.cpp uses AssetManager + "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # ObjectIdManager.h "${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # GameMessages.h "${PROJECT_SOURCE_DIR}/dGame/dComponents" # ModelComponent.h ) diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index 8d95e220f..be23d8665 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -19,7 +19,7 @@ list(APPEND DCOMMONTEST_SOURCES ${DENUMS_TESTS}) add_executable(dCommonTests ${DCOMMONTEST_SOURCES}) # Link needed libraries -target_link_libraries(dCommonTests ${COMMON_LIBRARIES} dGame GTest::gtest_main) +target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main) # Copy test files to testing directory add_subdirectory(TestBitStreams) From cb84dbcc2234deaa652ef5c3703b6f78deb954d0 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 20:59:52 +0100 Subject: [PATCH 13/26] fix: macos? --- tests/CMakeLists.txt | 5 ++++- tests/dCommonTests/CMakeLists.txt | 1 + tests/dGameTests/CMakeLists.txt | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ec5498487..6c4e8d38f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,7 +4,10 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -unset(CMAKE_RUNTIME_OUTPUT_DIRECTORY) # for now +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) + +add_custom_target(conncpp_tests + ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) # Add the subdirectories add_subdirectory(dCommonTests) diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index be23d8665..01c725054 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -17,6 +17,7 @@ list(APPEND DCOMMONTEST_SOURCES ${DENUMS_TESTS}) # Set our executable add_executable(dCommonTests ${DCOMMONTEST_SOURCES}) +add_dependencies(dCommonTests conncpp_tests) # Link needed libraries target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main) diff --git a/tests/dGameTests/CMakeLists.txt b/tests/dGameTests/CMakeLists.txt index 9a76bc82c..20d7e530f 100644 --- a/tests/dGameTests/CMakeLists.txt +++ b/tests/dGameTests/CMakeLists.txt @@ -12,6 +12,7 @@ file(COPY ${GAMEMESSAGE_TESTBITSTREAMS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) # Add the executable. Remember to add all tests above this! add_executable(dGameTests ${DGAMETEST_SOURCES}) +add_dependencies(dCommonTests conncpp_tests) target_link_libraries(dGameTests ${COMMON_LIBRARIES} GTest::gtest_main dGame dScripts dPhysics Detour Recast tinyxml2 dWorldServer dZoneManager dChatFilter dNavigation) From 7c1c4d758163022212b7555258cc8add7b1aef7e Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 21:01:13 +0100 Subject: [PATCH 14/26] fix: Dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index caf4c49fc..efb82b42b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,6 @@ RUN --mount=type=cache,id=build-apt-cache,target=/var/cache/apt \ # Grab libraries and load them COPY --from=build /app/build/mariadbcpp/libmariadbcpp.so /usr/local/lib/ -COPY --from=build /app/build/mariadbcpp/libmariadb.so.3 /usr/local/lib/ RUN ldconfig # Server bins From 94c56e527a2e09df73428c22a7823aad3fd4c24a Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 21:17:44 +0100 Subject: [PATCH 15/26] fix: macos? --- tests/dCommonTests/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index 01c725054..db91d7abd 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -19,6 +19,15 @@ list(APPEND DCOMMONTEST_SOURCES ${DENUMS_TESTS}) add_executable(dCommonTests ${DCOMMONTEST_SOURCES}) add_dependencies(dCommonTests conncpp_tests) +if(APPLE) +add_custom_command(TARGET dCommonTests POST_BUILD + COMMAND otool ARGS -L dCommonTests + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +add_custom_command(TARGET dCommonTests POST_BUILD + COMMAND ls + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +endif() + # Link needed libraries target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main) From dab70ac096de2f34c5c32e098d55dc28a4db8fd4 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 21:45:50 +0100 Subject: [PATCH 16/26] fix: macos? --- tests/dCommonTests/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index db91d7abd..0d7e4436d 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -20,6 +20,9 @@ add_executable(dCommonTests ${DCOMMONTEST_SOURCES}) add_dependencies(dCommonTests conncpp_tests) if(APPLE) +add_custom_command(TARGET dCommonTests POST_BUILD + COMMAND otool ARGS -l dCommonTests + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) add_custom_command(TARGET dCommonTests POST_BUILD COMMAND otool ARGS -L dCommonTests WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) From 4569ea29d53e20ffb92868d5613f933db097ce0d Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 22:18:39 +0100 Subject: [PATCH 17/26] fix: macos? --- cmake/FindMariaDB.cmake | 9 +++++++-- tests/CMakeLists.txt | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index d9c4a8827..470546974 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -134,10 +134,15 @@ message("libmariadb: ${MARIADBC_SHARED_LIBRARY_LOCATION}") message("libmariadbcpp: ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") add_library(MariaDB::ConnCpp SHARED IMPORTED GLOBAL) add_dependencies(MariaDB::ConnCpp mariadb_connector_cpp) -set_property(TARGET MariaDB::ConnCpp PROPERTY IMPORTED_LOCATION ${MARIADBCPP_SHARED_LIBRARY_LOCATION}) +set_target_properties(MariaDB::ConnCpp PROPERTIES + IMPORTED_LOCATION "${MARIADBCPP_SHARED_LIBRARY_LOCATION}") if(WIN32) - set_property(TARGET MariaDB::ConnCpp PROPERTY IMPORTED_IMPLIB ${MARIADB_IMPLIB_LOCATION}) + set_target_properties(MariaDB::ConnCpp PROPERTIES + IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}") +elseif(APPLE) + set_target_properties(MariaDB::ConnCpp PROPERTIES + MACOSX_RPATH TRUE) endif() # Add directories to include lists diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6c4e8d38f..62de71d7a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,6 +6,10 @@ include(GoogleTest) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) +set(CMAKE_BUILD_WITH_INSTALL_RPATH True) +set(CMAKE_INSTALL_RPATH "@executable_path") + add_custom_target(conncpp_tests ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) From a52cfb5b0bbc61fe96fde43703fc1f1a3dcce427 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 22:32:27 +0100 Subject: [PATCH 18/26] fix: macos? --- cmake/FindMariaDB.cmake | 3 ++- tests/CMakeLists.txt | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 470546974..2a76e0aaa 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -142,7 +142,8 @@ if(WIN32) IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}") elseif(APPLE) set_target_properties(MariaDB::ConnCpp PROPERTIES - MACOSX_RPATH TRUE) + MACOSX_RPATH TRUE + INSTALL_NAME_DIR "@rpath") endif() # Add directories to include lists diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 62de71d7a..e8765191f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,9 +6,11 @@ include(GoogleTest) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) -set(CMAKE_BUILD_WITH_INSTALL_RPATH True) -set(CMAKE_INSTALL_RPATH "@executable_path") +if(APPLE) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) + set(CMAKE_BUILD_WITH_INSTALL_RPATH True) + set(CMAKE_INSTALL_RPATH "@executable_path") +endif() add_custom_target(conncpp_tests ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) From decce5b4c5b86fe06b332a96c93e46d7d69d3bdd Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 22:54:07 +0100 Subject: [PATCH 19/26] fix: macos? --- cmake/FindMariaDB.cmake | 3 +-- tests/dCommonTests/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 2a76e0aaa..dc51f1500 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -142,8 +142,7 @@ if(WIN32) IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}") elseif(APPLE) set_target_properties(MariaDB::ConnCpp PROPERTIES - MACOSX_RPATH TRUE - INSTALL_NAME_DIR "@rpath") + IMPORTED_SONAME "libmariadbcpp") endif() # Add directories to include lists diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index 0d7e4436d..6af0c56b2 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -29,6 +29,9 @@ add_custom_command(TARGET dCommonTests POST_BUILD add_custom_command(TARGET dCommonTests POST_BUILD COMMAND ls WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +add_custom_command(TARGET dCommonTests POST_BUILD + COMMAND otool ARGS -D libmariadbcpp.dylib + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) endif() # Link needed libraries From 6b94e7f9edd2b1211d149d013aba9cd1b62a983d Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 23:29:40 +0100 Subject: [PATCH 20/26] try: install_name_tool --- tests/dCommonTests/CMakeLists.txt | 8 ++------ tests/dGameTests/CMakeLists.txt | 9 ++++++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index 6af0c56b2..2fe0e3091 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -22,15 +22,11 @@ add_dependencies(dCommonTests conncpp_tests) if(APPLE) add_custom_command(TARGET dCommonTests POST_BUILD COMMAND otool ARGS -l dCommonTests - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) -add_custom_command(TARGET dCommonTests POST_BUILD COMMAND otool ARGS -L dCommonTests - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) -add_custom_command(TARGET dCommonTests POST_BUILD COMMAND ls - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) -add_custom_command(TARGET dCommonTests POST_BUILD COMMAND otool ARGS -D libmariadbcpp.dylib + COMMAND install_name_tool ARGS -change libmariadbcpp.dylib @rpath/libmariadbcpp.dylib dCommonTests + COMMAND otool ARGS -L dCommonTests WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) endif() diff --git a/tests/dGameTests/CMakeLists.txt b/tests/dGameTests/CMakeLists.txt index 20d7e530f..5bf4c81f1 100644 --- a/tests/dGameTests/CMakeLists.txt +++ b/tests/dGameTests/CMakeLists.txt @@ -12,7 +12,14 @@ file(COPY ${GAMEMESSAGE_TESTBITSTREAMS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) # Add the executable. Remember to add all tests above this! add_executable(dGameTests ${DGAMETEST_SOURCES}) -add_dependencies(dCommonTests conncpp_tests) +add_dependencies(dGameTests conncpp_tests) + +if(APPLE) +add_custom_command(TARGET dGameTests POST_BUILD + COMMAND install_name_tool ARGS -change libmariadbcpp.dylib @rpath/libmariadbcpp.dylib dGameTests + COMMAND otool ARGS -L dGameTests + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +endif() target_link_libraries(dGameTests ${COMMON_LIBRARIES} GTest::gtest_main dGame dScripts dPhysics Detour Recast tinyxml2 dWorldServer dZoneManager dChatFilter dNavigation) From 8907cd467daa5a145fbe967a65a8c8f3aba444ec Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Thu, 25 Jan 2024 02:45:47 -0800 Subject: [PATCH 21/26] fix not building on unix --- dMasterServer/CMakeLists.txt | 4 +++- dServer/CMakeLists.txt | 4 ++++ dWorldServer/CMakeLists.txt | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dMasterServer/CMakeLists.txt b/dMasterServer/CMakeLists.txt index f29e1eb49..260e4f16a 100644 --- a/dMasterServer/CMakeLists.txt +++ b/dMasterServer/CMakeLists.txt @@ -9,9 +9,11 @@ add_executable(MasterServer "MasterServer.cpp") add_compile_definitions(MasterServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") target_include_directories(dMasterServer PUBLIC "." "${PROJECT_SOURCE_DIR}/dZoneManager" # InstanceManager.h uses dZMCommon.h + ${PROJECT_SOURCE_DIR}/dServer/ # BinaryPathFinder.h ) + target_link_libraries(dMasterServer ${COMMON_LIBRARIES}) -target_link_libraries(MasterServer ${COMMON_LIBRARIES} bcrypt dMasterServer) +target_link_libraries(MasterServer ${COMMON_LIBRARIES} bcrypt dMasterServer dServer) if(WIN32) add_dependencies(MasterServer WorldServer AuthServer ChatServer) diff --git a/dServer/CMakeLists.txt b/dServer/CMakeLists.txt index 356e55b7b..f0952eb78 100644 --- a/dServer/CMakeLists.txt +++ b/dServer/CMakeLists.txt @@ -4,3 +4,7 @@ set(DSERVER_SOURCES add_library(dServer STATIC ${DSERVER_SOURCES}) target_include_directories(dServer PUBLIC ".") + +target_include_directories(dServer PRIVATE + ${PROJECT_SOURCE_DIR}/dCommon/ # BinaryPathFinder.h +) diff --git a/dWorldServer/CMakeLists.txt b/dWorldServer/CMakeLists.txt index 5eb11a097..1239a3c18 100644 --- a/dWorldServer/CMakeLists.txt +++ b/dWorldServer/CMakeLists.txt @@ -8,6 +8,10 @@ target_link_libraries(dWorldServer PUBLIC dGameBase dCommon) add_executable(WorldServer "WorldServer.cpp") add_compile_definitions(WorldServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") +target_include_directories(WorldServer PRIVATE + ${PROJECT_SOURCE_DIR}/dServer/ # BinaryPathFinder.h +) + target_link_libraries(WorldServer ${COMMON_LIBRARIES} dScripts dGameBase @@ -15,4 +19,4 @@ target_link_libraries(WorldServer ${COMMON_LIBRARIES} dUtilities dGameMessages dInventory - dGame dChatFilter dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dNavigation) + dGame dChatFilter dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dNavigation dServer) From 247b88dbd5b2aa3449d0f78bde40aeb7aa6a2e5b Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Sun, 3 Mar 2024 04:27:19 -0800 Subject: [PATCH 22/26] fix include paths --- dGame/dComponents/CharacterComponent.h | 3 ++- dGame/dUtilities/Loot.h | 1 + dNet/AuthPackets.cpp | 2 +- dNet/CMakeLists.txt | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dGame/dComponents/CharacterComponent.h b/dGame/dComponents/CharacterComponent.h index 797347edc..aa5c2e29e 100644 --- a/dGame/dComponents/CharacterComponent.h +++ b/dGame/dComponents/CharacterComponent.h @@ -5,7 +5,6 @@ #include "RakNetTypes.h" #include "Character.h" #include "Component.h" -#include "Item.h" #include #include "CDMissionsTable.h" #include "tinyxml2.h" @@ -15,6 +14,8 @@ enum class eGameActivity : uint32_t; +class Item; + /** * The statistics that can be achieved per zone */ diff --git a/dGame/dUtilities/Loot.h b/dGame/dUtilities/Loot.h index dacd3dcdd..ac4d52332 100644 --- a/dGame/dUtilities/Loot.h +++ b/dGame/dUtilities/Loot.h @@ -1,6 +1,7 @@ #pragma once #include "dCommonVars.h" +#include "eLootSourceType.h" #include class Entity; diff --git a/dNet/AuthPackets.cpp b/dNet/AuthPackets.cpp index 2ba33ab5e..dce7e8e95 100644 --- a/dNet/AuthPackets.cpp +++ b/dNet/AuthPackets.cpp @@ -8,7 +8,7 @@ #include "ZoneInstanceManager.h" #include "MD5.h" #include "GeneralUtils.h" -#include "ClientVersion.h" +#include "dClient/ClientVersion.h" #include diff --git a/dNet/CMakeLists.txt b/dNet/CMakeLists.txt index 45f1cdbf9..000363bed 100644 --- a/dNet/CMakeLists.txt +++ b/dNet/CMakeLists.txt @@ -8,7 +8,7 @@ set(DNET_SOURCES "AuthPackets.cpp" "ZoneInstanceManager.cpp") add_library(dNet STATIC ${DNET_SOURCES}) -target_link_libraries(dNet PRIVATE bcrypt) +target_link_libraries(dNet PRIVATE bcrypt MD5) target_include_directories(dNet PRIVATE ${PROJECT_SOURCE_DIR}/dCommon ${PROJECT_SOURCE_DIR}/dCommon/dEnums From da15c6d16b3fe2b37162d72b3a43155e62cddd16 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Sun, 3 Mar 2024 04:32:31 -0800 Subject: [PATCH 23/26] Remove code changes Will fix in another PR. --- dGame/dComponents/CharacterComponent.h | 3 +-- dGame/dUtilities/Loot.h | 1 - dNet/AuthPackets.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dGame/dComponents/CharacterComponent.h b/dGame/dComponents/CharacterComponent.h index aa5c2e29e..797347edc 100644 --- a/dGame/dComponents/CharacterComponent.h +++ b/dGame/dComponents/CharacterComponent.h @@ -5,6 +5,7 @@ #include "RakNetTypes.h" #include "Character.h" #include "Component.h" +#include "Item.h" #include #include "CDMissionsTable.h" #include "tinyxml2.h" @@ -14,8 +15,6 @@ enum class eGameActivity : uint32_t; -class Item; - /** * The statistics that can be achieved per zone */ diff --git a/dGame/dUtilities/Loot.h b/dGame/dUtilities/Loot.h index ac4d52332..dacd3dcdd 100644 --- a/dGame/dUtilities/Loot.h +++ b/dGame/dUtilities/Loot.h @@ -1,7 +1,6 @@ #pragma once #include "dCommonVars.h" -#include "eLootSourceType.h" #include class Entity; diff --git a/dNet/AuthPackets.cpp b/dNet/AuthPackets.cpp index dce7e8e95..2ba33ab5e 100644 --- a/dNet/AuthPackets.cpp +++ b/dNet/AuthPackets.cpp @@ -8,7 +8,7 @@ #include "ZoneInstanceManager.h" #include "MD5.h" #include "GeneralUtils.h" -#include "dClient/ClientVersion.h" +#include "ClientVersion.h" #include From 6735acd8044453c4a407d182c23b8c0ac8ba8fce Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Mon, 4 Mar 2024 03:30:01 -0800 Subject: [PATCH 24/26] format pass remove 2 more included directories. remove commented out code add status to messages --- CMakeLists.txt | 6 +----- cmake/FindMariaDB.cmake | 12 +++++------- dChatServer/CMakeLists.txt | 6 ++++-- dGame/CMakeLists.txt | 2 +- dGame/dComponents/CMakeLists.txt | 9 ++------- dNavigation/CMakeLists.txt | 1 + dWorldServer/CMakeLists.txt | 1 + 7 files changed, 15 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca84e8348..eaf8f7503 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ endif() # Our output dir set(CMAKE_BINARY_DIR ${PROJECT_BINARY_DIR}) -#set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) # unfortunately, serializes everything +#set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) # unfortunately, forces all libraries to be built in series, which will slow down the build process # TODO make this not have to override the build type directories set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}) @@ -215,12 +215,9 @@ add_subdirectory(thirdparty) # Create our list of include directories set(INCLUDED_DIRECTORIES - "dChatFilter" - "dPhysics" "dNavigation" - "dNavigation/dTerrain" "dNet" @@ -250,7 +247,6 @@ foreach(dir ${INCLUDED_DIRECTORIES}) endforeach() # Add linking directories: -# link_directories(${PROJECT_BINARY_DIR}) if (UNIX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") endif() diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index dc51f1500..dbf0df6b7 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -23,14 +23,14 @@ if(WIN32 AND NOT MARIADB_BUILD_SOURCE) set(MARIADB_CONNECTOR_CPP_MSI "mariadb-connector-cpp-${MARIADB_CONNECTOR_CPP_VERSION}-win64.msi") if(NOT EXISTS "${MARIADB_MSI_DIR}/${MARIADB_CONNECTOR_C_MSI}" ) - message("Downloading mariadb connector/c") + message(STATUS "Downloading mariadb connector/c") file(DOWNLOAD https://dlm.mariadb.com/${MARIADB_CONNECTOR_C_BUCKET}/Connectors/c/connector-c-${MARIADB_CONNECTOR_C_VERSION}/${MARIADB_CONNECTOR_C_MSI} "${MARIADB_MSI_DIR}/${MARIADB_CONNECTOR_C_MSI}" EXPECTED_HASH MD5=${MARIADB_CONNECTOR_C_MD5}) endif() if(NOT EXISTS "${MARIADB_MSI_DIR}/${MARIADB_CONNECTOR_CPP_MSI}" ) - message("Downloading mariadb connector/c++") + message(STATUS "Downloading mariadb connector/c++") file(DOWNLOAD https://dlm.mariadb.com/${MARIADB_CONNECTOR_CPP_BUCKET}/Connectors/cpp/connector-cpp-${MARIADB_CONNECTOR_CPP_VERSION}/${MARIADB_CONNECTOR_CPP_MSI} "${MARIADB_MSI_DIR}/${MARIADB_CONNECTOR_CPP_MSI}" EXPECTED_HASH MD5=${MARIADB_CONNECTOR_CPP_MD5}) @@ -87,7 +87,7 @@ else() # Build from source endif() set(MARIADBCPP_INSTALL_DIR ${PROJECT_BINARY_DIR}/prefix) - message("MariaDB C/C++ install prefix: " ${MARIADBCPP_INSTALL_DIR}) + message(STATUS "MariaDB C/C++ install prefix: " ${MARIADBCPP_INSTALL_DIR}) set(MARIADBCPP_LIBRARY_DIR ${PROJECT_BINARY_DIR}/mariadbcpp) set(MARIADBCPP_PLUGIN_DIR ${MARIADBCPP_LIBRARY_DIR}/plugin) set(MARIADBCPP_SOURCE_DIR ${PROJECT_SOURCE_DIR}/thirdparty/mariadb-connector-cpp) @@ -124,14 +124,12 @@ else() # Build from source set(MARIADBCPP_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/${MARIADB_SHARED_LIBRARY_NAME}") if(WIN32) set(MARIADBC_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/libmariadb.lib") - #elseif(UNIX) - # set(MARIADBC_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/libmariadb.so.3") endif() endif() # Create mariadb connector library object -message("libmariadb: ${MARIADBC_SHARED_LIBRARY_LOCATION}") -message("libmariadbcpp: ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") +message(STATUS "libmariadb: ${MARIADBC_SHARED_LIBRARY_LOCATION}") +message(STATUS "libmariadbcpp: ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") add_library(MariaDB::ConnCpp SHARED IMPORTED GLOBAL) add_dependencies(MariaDB::ConnCpp mariadb_connector_cpp) set_target_properties(MariaDB::ConnCpp PROPERTIES diff --git a/dChatServer/CMakeLists.txt b/dChatServer/CMakeLists.txt index cc4cee1f5..c7eea041e 100644 --- a/dChatServer/CMakeLists.txt +++ b/dChatServer/CMakeLists.txt @@ -5,10 +5,12 @@ set(DCHATSERVER_SOURCES ) add_executable(ChatServer "ChatServer.cpp") -add_library(dChatServer ${DCHATSERVER_SOURCES}) -target_include_directories(dChatServer PRIVATE ${PROJECT_SOURCE_DIR}/dServer) +target_include_directories(ChatServer PRIVATE "${PROJECT_SOURCE_DIR}/dChatFilter") 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) diff --git a/dGame/CMakeLists.txt b/dGame/CMakeLists.txt index 1a59390f7..26eb859a9 100644 --- a/dGame/CMakeLists.txt +++ b/dGame/CMakeLists.txt @@ -64,4 +64,4 @@ target_include_directories(dGame INTERFACE $ $ $ -) \ No newline at end of file +) diff --git a/dGame/dComponents/CMakeLists.txt b/dGame/dComponents/CMakeLists.txt index c402e0e84..9c58a0ea2 100644 --- a/dGame/dComponents/CMakeLists.txt +++ b/dGame/dComponents/CMakeLists.txt @@ -74,13 +74,8 @@ target_include_directories(dComponents PUBLIC "." "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # direct Loot.h "${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager/Spawner.h "${PROJECT_SOURCE_DIR}/dZoneManager" # via BouncerComponent.cpp, ActivityComponent.cpp + "${PROJECT_SOURCE_DIR}/dChatFilter" # via PetComponent.cpp ) target_precompile_headers(dComponents REUSE_FROM dGameBase) -# INTERFACE link w/o dependency -#set_property(TARGET dComponents APPEND PROPERTY INTERFACE_LINK_LIBRARIES -# dUtilities dCommon dBehaviors dChatFilter dMission dInventory -# dPhysics -#) - -target_link_libraries(dComponents INTERFACE dBehaviors) \ No newline at end of file +target_link_libraries(dComponents INTERFACE dBehaviors) diff --git a/dNavigation/CMakeLists.txt b/dNavigation/CMakeLists.txt index c2a53ca27..e2a1c6ef3 100644 --- a/dNavigation/CMakeLists.txt +++ b/dNavigation/CMakeLists.txt @@ -12,5 +12,6 @@ target_include_directories(dNavigation PUBLIC "." "${PROJECT_SOURCE_DIR}/dZoneManager" "${PROJECT_SOURCE_DIR}/dGame" "${PROJECT_SOURCE_DIR}/dGame/dEntity" + "${PROJECT_SOURCE_DIR}/dNavigation/dTerrain" # via dNavMesh.cpp ) target_link_libraries(dNavigation PRIVATE Detour Recast dCommon) diff --git a/dWorldServer/CMakeLists.txt b/dWorldServer/CMakeLists.txt index 1239a3c18..ec80c1838 100644 --- a/dWorldServer/CMakeLists.txt +++ b/dWorldServer/CMakeLists.txt @@ -6,6 +6,7 @@ add_library(dWorldServer OBJECT ${DWORLDSERVER_SOURCES}) target_link_libraries(dWorldServer PUBLIC dGameBase dCommon) add_executable(WorldServer "WorldServer.cpp") +target_include_directories(WorldServer PRIVATE "${PROJECT_SOURCE_DIR}/dChatFilter") add_compile_definitions(WorldServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") target_include_directories(WorldServer PRIVATE From 274d3e99dcfede295b13b4d0c5a6d79fe3cb3335 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Mon, 4 Mar 2024 03:44:23 -0800 Subject: [PATCH 25/26] comments and format surround include directories with quotes remove commented out code remove debug messages --- cmake/FindMariaDB.cmake | 3 --- dNet/CMakeLists.txt | 34 ++++++++++++++----------------- dServer/CMakeLists.txt | 2 +- dWorldServer/CMakeLists.txt | 2 +- dZoneManager/CMakeLists.txt | 16 +++++++-------- tests/dCommonTests/CMakeLists.txt | 1 + tests/dGameTests/CMakeLists.txt | 1 + 7 files changed, 27 insertions(+), 32 deletions(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index dbf0df6b7..f42ac47b6 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -87,7 +87,6 @@ else() # Build from source endif() set(MARIADBCPP_INSTALL_DIR ${PROJECT_BINARY_DIR}/prefix) - message(STATUS "MariaDB C/C++ install prefix: " ${MARIADBCPP_INSTALL_DIR}) set(MARIADBCPP_LIBRARY_DIR ${PROJECT_BINARY_DIR}/mariadbcpp) set(MARIADBCPP_PLUGIN_DIR ${MARIADBCPP_LIBRARY_DIR}/plugin) set(MARIADBCPP_SOURCE_DIR ${PROJECT_SOURCE_DIR}/thirdparty/mariadb-connector-cpp) @@ -128,8 +127,6 @@ else() # Build from source endif() # Create mariadb connector library object -message(STATUS "libmariadb: ${MARIADBC_SHARED_LIBRARY_LOCATION}") -message(STATUS "libmariadbcpp: ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") add_library(MariaDB::ConnCpp SHARED IMPORTED GLOBAL) add_dependencies(MariaDB::ConnCpp mariadb_connector_cpp) set_target_properties(MariaDB::ConnCpp PROPERTIES diff --git a/dNet/CMakeLists.txt b/dNet/CMakeLists.txt index 000363bed..15cdda42b 100644 --- a/dNet/CMakeLists.txt +++ b/dNet/CMakeLists.txt @@ -10,26 +10,22 @@ set(DNET_SOURCES "AuthPackets.cpp" add_library(dNet STATIC ${DNET_SOURCES}) target_link_libraries(dNet PRIVATE bcrypt MD5) target_include_directories(dNet PRIVATE - ${PROJECT_SOURCE_DIR}/dCommon - ${PROJECT_SOURCE_DIR}/dCommon/dEnums + "${PROJECT_SOURCE_DIR}/dCommon" + "${PROJECT_SOURCE_DIR}/dCommon/dEnums" - ${PROJECT_SOURCE_DIR}/dZoneManager + "${PROJECT_SOURCE_DIR}/dZoneManager" - ${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase - ${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/CDClientTables - ${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase - ${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase/ITables - ${PROJECT_SOURCE_DIR}/thirdparty/mariadb-connector-cpp/include + "${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase" + "${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/CDClientTables" + "${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase" + "${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase/ITables" + "${PROJECT_SOURCE_DIR}/thirdparty/mariadb-connector-cpp/include" - ${PROJECT_SOURCE_DIR}/dGame # UserManager.h - ${PROJECT_SOURCE_DIR}/dGame/dComponents - ${PROJECT_SOURCE_DIR}/dGame/dEntity # via dZoneManager - ${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 + "${PROJECT_SOURCE_DIR}/dGame" # UserManager.h + "${PROJECT_SOURCE_DIR}/dGame/dComponents" + "${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager + "${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 ) - -#set_property(TARGET dNet APPEND PROPERTY INTERFACE_LINK_LIBRARIES -# dCommon dDatabase -#) diff --git a/dServer/CMakeLists.txt b/dServer/CMakeLists.txt index f0952eb78..ca4e61984 100644 --- a/dServer/CMakeLists.txt +++ b/dServer/CMakeLists.txt @@ -6,5 +6,5 @@ add_library(dServer STATIC ${DSERVER_SOURCES}) target_include_directories(dServer PUBLIC ".") target_include_directories(dServer PRIVATE - ${PROJECT_SOURCE_DIR}/dCommon/ # BinaryPathFinder.h + "${PROJECT_SOURCE_DIR}/dCommon/" # BinaryPathFinder.h ) diff --git a/dWorldServer/CMakeLists.txt b/dWorldServer/CMakeLists.txt index ec80c1838..62a3767aa 100644 --- a/dWorldServer/CMakeLists.txt +++ b/dWorldServer/CMakeLists.txt @@ -10,7 +10,7 @@ target_include_directories(WorldServer PRIVATE "${PROJECT_SOURCE_DIR}/dChatFilte add_compile_definitions(WorldServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") target_include_directories(WorldServer PRIVATE - ${PROJECT_SOURCE_DIR}/dServer/ # BinaryPathFinder.h + "${PROJECT_SOURCE_DIR}/dServer" # BinaryPathFinder.h ) target_link_libraries(WorldServer ${COMMON_LIBRARIES} diff --git a/dZoneManager/CMakeLists.txt b/dZoneManager/CMakeLists.txt index ba860e0f6..544a01d9e 100644 --- a/dZoneManager/CMakeLists.txt +++ b/dZoneManager/CMakeLists.txt @@ -11,12 +11,12 @@ target_link_libraries(dZoneManager #set_property(TARGET dZoneManager APPEND PROPERTY INTERFACE_LINK_LIBRARIES dWorldServer) target_include_directories(dZoneManager PUBLIC "." - ${PROJECT_SOURCE_DIR}/dGame # Entity.h - ${PROJECT_SOURCE_DIR}/dGame/dEntity # EntityInfo.h + "${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 -) \ No newline at end of file + "${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 +) diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index 2fe0e3091..cf0a03edd 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -19,6 +19,7 @@ list(APPEND DCOMMONTEST_SOURCES ${DENUMS_TESTS}) add_executable(dCommonTests ${DCOMMONTEST_SOURCES}) add_dependencies(dCommonTests conncpp_tests) +# Apple needs some special linkage for the mariadb connector for tests. if(APPLE) add_custom_command(TARGET dCommonTests POST_BUILD COMMAND otool ARGS -l dCommonTests diff --git a/tests/dGameTests/CMakeLists.txt b/tests/dGameTests/CMakeLists.txt index 5bf4c81f1..58f213e0a 100644 --- a/tests/dGameTests/CMakeLists.txt +++ b/tests/dGameTests/CMakeLists.txt @@ -14,6 +14,7 @@ file(COPY ${GAMEMESSAGE_TESTBITSTREAMS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) add_executable(dGameTests ${DGAMETEST_SOURCES}) add_dependencies(dGameTests conncpp_tests) +# Apple needs some special linkage for the mariadb connector for tests. if(APPLE) add_custom_command(TARGET dGameTests POST_BUILD COMMAND install_name_tool ARGS -change libmariadbcpp.dylib @rpath/libmariadbcpp.dylib dGameTests From e35dd196d45ca7d78250102bf6df30050c19b70b Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Tue, 5 Mar 2024 03:50:15 -0800 Subject: [PATCH 26/26] Update CMakeLists.txt --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index eaf8f7503..541b42661 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,6 +237,7 @@ set(INCLUDED_DIRECTORIES ) # Add system specfic includes for Apple, Windows and Other Unix OS' (including Linux) +# TODO: Should probably not do this. if(APPLE) include_directories("/usr/local/include/") endif()