mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/BuildSystem: Merge collision, debugging, threading, utilities and configuration into "common" which does not depend on shared anymore and moved database out of shared library
These changes enables to build tools only without even having MySQL installed
This commit is contained in:
@@ -60,7 +60,6 @@ find_package(OpenSSL REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
include(ConfigureBoost)
|
||||
find_package(MySQL REQUIRED)
|
||||
|
||||
if( UNIX )
|
||||
find_package(Readline)
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
add_subdirectory(genrev)
|
||||
add_subdirectory(server)
|
||||
add_subdirectory(common)
|
||||
|
||||
if(SERVERS)
|
||||
add_subdirectory(server)
|
||||
endif(SERVERS)
|
||||
|
||||
if(TOOLS)
|
||||
add_subdirectory(tools)
|
||||
|
||||
@@ -12,41 +12,48 @@ if( USE_COREPCH )
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE sources_Management Management/*.cpp Management/*.h)
|
||||
file(GLOB_RECURSE sources_Maps Maps/*.cpp Maps/*.h)
|
||||
file(GLOB_RECURSE sources_Models Models/*.cpp Models/*.h)
|
||||
file(GLOB_RECURSE sources_Common Common.cpp Common.h)
|
||||
file(GLOB_RECURSE sources_Collision Collision/*.cpp Collision/*.h)
|
||||
file(GLOB_RECURSE sources_Threading Threading/*.cpp Threading/*.h)
|
||||
file(GLOB_RECURSE sources_Threading Utilities/*.cpp Utilities/*.h)
|
||||
file(GLOB_RECURSE sources_Configuration Configuration/*.cpp Configuration/*.h)
|
||||
file(GLOB_RECURSE sources_Logging Logging/*.cpp Logging/*.h)
|
||||
|
||||
# Manually set sources for Debugging directory as we don't want to include WheatyExceptionReport in common project
|
||||
# It needs to be included both in authserver and worldserver for the static global variable to be properly initialized
|
||||
# and to handle crash logs on windows
|
||||
set(sources_Debugging Debugging/Errors.cpp Debugging/Errors.h)
|
||||
file(GLOB sources_localdir *.cpp *.h)
|
||||
|
||||
if (USE_COREPCH)
|
||||
set(collision_STAT_PCH_HDR PrecompiledHeaders/collisionPCH.h)
|
||||
set(collision_STAT_PCH_SRC PrecompiledHeaders/collisionPCH.cpp)
|
||||
set(common_STAT_PCH_HDR PrecompiledHeaders/commonPCH.h)
|
||||
set(common_STAT_PCH_SRC PrecompiledHeaders/commonPCH.cpp)
|
||||
endif ()
|
||||
|
||||
set(collision_STAT_SRCS
|
||||
${collision_STAT_SRCS}
|
||||
${sources_Management}
|
||||
${sources_Maps}
|
||||
${sources_Models}
|
||||
${sources_localdir}
|
||||
set(common_STAT_SRCS
|
||||
${common_STAT_SRCS}
|
||||
${sources_Common}
|
||||
${sources_Collision}
|
||||
${sources_Threading}
|
||||
${sources_Debugging}
|
||||
${sources_Configuration}
|
||||
${sources_Logging}
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/dep/utf8cpp
|
||||
${CMAKE_SOURCE_DIR}/dep/SFMT
|
||||
${CMAKE_SOURCE_DIR}/dep/g3dlite/include
|
||||
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour
|
||||
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour/Include
|
||||
${CMAKE_SOURCE_DIR}/dep/cppformat
|
||||
${CMAKE_SOURCE_DIR}/src/server/database
|
||||
${CMAKE_SOURCE_DIR}/src/server/database/Database
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Configuration
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Database
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Dynamic/LinkedReference
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Logging
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Threading
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Packets
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Utilities
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/DataStores
|
||||
${CMAKE_SOURCE_DIR}/src/server/game/Addons
|
||||
${CMAKE_SOURCE_DIR}/src/server/game/Conditions
|
||||
@@ -73,25 +80,26 @@ include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/server/game/Spells
|
||||
${CMAKE_SOURCE_DIR}/src/server/game/Spells/Auras
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Management
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Maps
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Models
|
||||
${MYSQL_INCLUDE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Threading
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Debugging
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Collision
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Collision/Management
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Collision/Maps
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Collision/Models
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Utilities
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Configuration
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Logging
|
||||
${VALGRIND_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_library(collision STATIC
|
||||
${collision_STAT_SRCS}
|
||||
${collision_STAT_PCH_SRC}
|
||||
)
|
||||
|
||||
target_link_libraries(collision
|
||||
shared
|
||||
add_library(common STATIC
|
||||
${common_STAT_SRCS}
|
||||
${common_STAT_PCH_SRC}
|
||||
)
|
||||
|
||||
# Generate precompiled header
|
||||
if (USE_COREPCH)
|
||||
add_cxx_pch(collision ${collision_STAT_PCH_HDR} ${collision_STAT_PCH_SRC})
|
||||
add_cxx_pch(common ${common_STAT_PCH_HDR} ${common_STAT_PCH_SRC})
|
||||
endif ()
|
||||
@@ -18,7 +18,8 @@
|
||||
|
||||
#include "MMapManager.h"
|
||||
#include "Log.h"
|
||||
#include "World.h"
|
||||
#include "Config.h"
|
||||
#include "SharedDefines.h"
|
||||
|
||||
namespace MMAP
|
||||
{
|
||||
@@ -69,9 +70,10 @@ namespace MMAP
|
||||
}
|
||||
|
||||
// load and init dtNavMesh - read parameters from file
|
||||
uint32 pathLen = sWorld->GetDataPath().length() + strlen("mmaps/%03i.mmap")+1;
|
||||
std::string dataDir = sConfigMgr->GetStringDefault("DataDir", "./");
|
||||
uint32 pathLen = dataDir.length() + strlen("/mmaps/%03i.mmap") + 1;
|
||||
char *fileName = new char[pathLen];
|
||||
snprintf(fileName, pathLen, (sWorld->GetDataPath()+"mmaps/%03i.mmap").c_str(), mapId);
|
||||
snprintf(fileName, pathLen, (dataDir + "/mmaps/%03i.mmap").c_str(), mapId);
|
||||
|
||||
FILE* file = fopen(fileName, "rb");
|
||||
if (!file)
|
||||
@@ -118,7 +120,7 @@ namespace MMAP
|
||||
return uint32(x << 16 | y);
|
||||
}
|
||||
|
||||
bool MMapManager::loadMap(const std::string& /*basePath*/, uint32 mapId, int32 x, int32 y)
|
||||
bool MMapManager::loadMap(const std::string& basePath, uint32 mapId, int32 x, int32 y)
|
||||
{
|
||||
// make sure the mmap is loaded and ready to load tiles
|
||||
if (!loadMapData(mapId))
|
||||
@@ -134,10 +136,10 @@ namespace MMAP
|
||||
return false;
|
||||
|
||||
// load this tile :: mmaps/MMMXXYY.mmtile
|
||||
uint32 pathLen = sWorld->GetDataPath().length() + strlen("mmaps/%03i%02i%02i.mmtile")+1;
|
||||
uint32 pathLen = basePath.length() + strlen("/%03i%02i%02i.mmtile") + 1;
|
||||
char *fileName = new char[pathLen];
|
||||
|
||||
snprintf(fileName, pathLen, (sWorld->GetDataPath()+"mmaps/%03i%02i%02i.mmtile").c_str(), mapId, x, y);
|
||||
snprintf(fileName, pathLen, (basePath + "/%03i%02i%02i.mmtile").c_str(), mapId, x, y);
|
||||
|
||||
FILE* file = fopen(fileName, "rb");
|
||||
if (!file)
|
||||
@@ -22,8 +22,6 @@
|
||||
#include <G3D/CollisionDetection.h>
|
||||
#include <G3D/AABox.h>
|
||||
|
||||
#include "NodeValueAccess.h"
|
||||
|
||||
/**
|
||||
The Class is mainly taken from G3D/AABSPTree.h but modified to be able to use our internal data structure.
|
||||
This is an iterator that helps us analysing the BSP-Trees.
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "Util.h"
|
||||
#include "AppenderConsole.h"
|
||||
#include "AppenderFile.h"
|
||||
#include "AppenderDB.h"
|
||||
#include "LogOperation.h"
|
||||
|
||||
#include <cstdio>
|
||||
1
src/common/PrecompiledHeaders/commonPCH.cpp
Normal file
1
src/common/PrecompiledHeaders/commonPCH.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "PrecompiledHeaders/commonPCH.h"
|
||||
13
src/common/PrecompiledHeaders/commonPCH.h
Normal file
13
src/common/PrecompiledHeaders/commonPCH.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "Define.h"
|
||||
#include "Common.h"
|
||||
#include "BoundingIntervalHierarchy.h"
|
||||
#include "BoundingIntervalHierarchyWrapper.h"
|
||||
#include "RegularGrid.h"
|
||||
#include "Collision/VMapDefinitions.h"
|
||||
#include "Collision/Maps/MapTree.h"
|
||||
#include "Collision/Models/WorldModel.h"
|
||||
#include "Collision/Models/ModelInstance.h"
|
||||
#include "Collision/Models/GameObjectModel.h"
|
||||
#include "Threading/ProducerConsumerQueue.h"
|
||||
#include "Utilities/TaskScheduler.h"
|
||||
#include "Utilities/EventMap.h"
|
||||
@@ -12,24 +12,20 @@
|
||||
# This to stop a few silly crashes that could have been avoided IF people
|
||||
# weren't doing some -O3 psychooptimizations etc.
|
||||
|
||||
find_package(MySQL REQUIRED)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW)
|
||||
add_definitions(-fno-delete-null-pointer-checks)
|
||||
endif()
|
||||
|
||||
if( SERVERS )
|
||||
set(sources_windows_Debugging
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging/WheatyExceptionReport.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging/WheatyExceptionReport.h
|
||||
)
|
||||
add_subdirectory(shared)
|
||||
add_subdirectory(game)
|
||||
add_subdirectory(collision)
|
||||
add_subdirectory(authserver)
|
||||
add_subdirectory(scripts)
|
||||
add_subdirectory(worldserver)
|
||||
else()
|
||||
if( TOOLS )
|
||||
add_subdirectory(collision)
|
||||
add_subdirectory(shared)
|
||||
endif()
|
||||
endif()
|
||||
set(sources_windows_Debugging
|
||||
${CMAKE_SOURCE_DIR}/src/common/Debugging/WheatyExceptionReport.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/common/Debugging/WheatyExceptionReport.h
|
||||
)
|
||||
add_subdirectory(database)
|
||||
add_subdirectory(shared)
|
||||
add_subdirectory(game)
|
||||
add_subdirectory(authserver)
|
||||
add_subdirectory(scripts)
|
||||
add_subdirectory(worldserver)
|
||||
|
||||
|
||||
@@ -45,22 +45,29 @@ include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/dep/cppformat
|
||||
${CMAKE_SOURCE_DIR}/dep/process
|
||||
${CMAKE_SOURCE_DIR}/src/server/database
|
||||
${CMAKE_SOURCE_DIR}/src/server/database/Database
|
||||
${CMAKE_SOURCE_DIR}/src/server/database/Logging
|
||||
${CMAKE_SOURCE_DIR}/src/server/database/Updater
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Configuration
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Database
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Packets
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography/Authentication
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Logging
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Networking
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Threading
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Updater
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Utilities
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared/Service
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Authentication
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Realms
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Server
|
||||
${CMAKE_SOURCE_DIR}/src/common/
|
||||
${CMAKE_SOURCE_DIR}/src/common/Collision
|
||||
${CMAKE_SOURCE_DIR}/src/common/Collision/Management
|
||||
${CMAKE_SOURCE_DIR}/src/common/Collision/Models
|
||||
${CMAKE_SOURCE_DIR}/src/common/Debugging
|
||||
${CMAKE_SOURCE_DIR}/src/common/Utilities
|
||||
${CMAKE_SOURCE_DIR}/src/common/Threading
|
||||
${CMAKE_SOURCE_DIR}/src/common/Configuration
|
||||
${CMAKE_SOURCE_DIR}/src/common/Logging
|
||||
${MYSQL_INCLUDE_DIR}
|
||||
${OPENSSL_INCLUDE_DIR}
|
||||
${VALGRIND_INCLUDE_DIR}
|
||||
@@ -80,8 +87,10 @@ if( NOT WIN32 )
|
||||
endif()
|
||||
|
||||
target_link_libraries(authserver
|
||||
common
|
||||
shared
|
||||
format
|
||||
database
|
||||
${MYSQL_LIBRARY}
|
||||
${OPENSSL_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include "collisionPCH.h"
|
||||
@@ -1,9 +0,0 @@
|
||||
#include "Define.h"
|
||||
#include "VMapDefinitions.h"
|
||||
#include "MapTree.h"
|
||||
#include "WorldModel.h"
|
||||
#include "ModelInstance.h"
|
||||
#include "BoundingIntervalHierarchy.h"
|
||||
#include "RegularGrid.h"
|
||||
#include "BoundingIntervalHierarchyWrapper.h"
|
||||
#include "GameObjectModel.h"
|
||||
74
src/server/database/CMakeLists.txt
Normal file
74
src/server/database/CMakeLists.txt
Normal file
@@ -0,0 +1,74 @@
|
||||
# Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
if( USE_COREPCH )
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE sources_Database Database/*.cpp Database/*.h)
|
||||
file(GLOB_RECURSE sources_Logging Logging/*.cpp Logging/*.h)
|
||||
file(GLOB_RECURSE sources_Updater Updater/*.cpp Updater/*.h)
|
||||
|
||||
file(GLOB sources_localdir *.cpp *.h)
|
||||
|
||||
#
|
||||
# Build shared sourcelist
|
||||
#
|
||||
|
||||
if (USE_COREPCH)
|
||||
set(database_STAT_PCH_HDR PrecompiledHeaders/databasePCH.h)
|
||||
set(database_STAT_PCH_SRC PrecompiledHeaders/databasePCH.cpp)
|
||||
endif()
|
||||
|
||||
set(database_STAT_SRCS
|
||||
${database_STAT_SRCS}
|
||||
${sources_Database}
|
||||
${sources_Logging}
|
||||
${sources_Updater}
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour
|
||||
${CMAKE_SOURCE_DIR}/dep/SFMT
|
||||
${CMAKE_SOURCE_DIR}/dep/cppformat
|
||||
${CMAKE_SOURCE_DIR}/dep/utf8cpp
|
||||
${CMAKE_SOURCE_DIR}/dep/process
|
||||
${CMAKE_SOURCE_DIR}/src/server
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Database
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Logging
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Updater
|
||||
${CMAKE_SOURCE_DIR}/src/common/
|
||||
${CMAKE_SOURCE_DIR}/src/common/Collision
|
||||
${CMAKE_SOURCE_DIR}/src/common/Collision/Management
|
||||
${CMAKE_SOURCE_DIR}/src/common/Collision/Models
|
||||
${CMAKE_SOURCE_DIR}/src/common/Debugging
|
||||
${CMAKE_SOURCE_DIR}/src/common/Threading
|
||||
${CMAKE_SOURCE_DIR}/src/common/Utilities
|
||||
${CMAKE_SOURCE_DIR}/src/common/Configuration
|
||||
${CMAKE_SOURCE_DIR}/src/common/Logging
|
||||
${CMAKE_SOURCE_DIR}/src/server/shared
|
||||
${MYSQL_INCLUDE_DIR}
|
||||
${OPENSSL_INCLUDE_DIR} # seems needed for Windows build
|
||||
${VALGRIND_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_library(database STATIC
|
||||
${database_STAT_SRCS}
|
||||
${database_STAT_PCH_SRC}
|
||||
)
|
||||
|
||||
# Generate precompiled header
|
||||
if (USE_COREPCH)
|
||||
add_cxx_pch(database ${database_STAT_PCH_HDR} ${database_STAT_PCH_SRC})
|
||||
endif ()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user