feat(Core/Shared): added new library - shared (#2416)

This commit is contained in:
Kargatum
2019-11-15 16:31:54 +07:00
committed by GitHub
parent 7a1ac8245b
commit f9a8de9be7
9 changed files with 55 additions and 34 deletions

View File

@@ -16,6 +16,7 @@ set(winDebugging
${CMAKE_SOURCE_DIR}/src/common/Debugging/WheatyExceptionReport.h)
endif()
add_subdirectory(shared)
add_subdirectory(game)
add_subdirectory(authserver)
add_subdirectory(scripts)

View File

@@ -31,18 +31,6 @@ endif()
# Group sources
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_library(authserver-interface INTERFACE)
CollectIncludeDirectories(
${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC_INCLUDES
# Exclude
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
target_include_directories(authserver-interface
INTERFACE
${PUBLIC_INCLUDES})
add_executable(authserver
${PRIVATE_SOURCES})
@@ -54,18 +42,24 @@ if(NOT WIN32)
endif()
target_link_libraries(authserver
PRIVATE
authserver-interface
PUBLIC
common)
shared)
CollectIncludeDirectories(
${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC_INCLUDES
# Exclude
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
target_include_directories(authserver
PUBLIC
${PUBLIC_INCLUDES}
PRIVATE
${CMAKE_CURRENT_BINARY_DIR})
set_target_properties(authserver
PROPERTIES
FOLDER
FOLDER
"server")
if( WIN32 )

View File

@@ -0,0 +1,32 @@
#
# Copyright (C) 2016+ AzerothCore <www.azerothcore.org>
#
CollectSourceFiles(
${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE_SOURCES)
# Group sources
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_library(shared
${PRIVATE_SOURCES})
CollectIncludeDirectories(
${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC_INCLUDES)
target_include_directories(shared
PUBLIC
${PUBLIC_INCLUDES}
PRIVATE
${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(shared
PUBLIC
common)
set_target_properties(shared
PROPERTIES
FOLDER
"server")

View File

@@ -6,9 +6,9 @@
#include "Common.h"
#include "RealmList.h"
#include "Database/DatabaseEnv.h"
#include "DatabaseEnv.h"
RealmList::RealmList() : m_UpdateInterval(0), m_NextUpdateTime(time(NULL)) { }
RealmList::RealmList() : m_UpdateInterval(0), m_NextUpdateTime(time(nullptr)) { }
// Load the realm list from the database
void RealmList::Initialize(uint32 updateInterval)

View File

@@ -70,4 +70,5 @@ private:
};
#define sRealmList ACE_Singleton<RealmList, ACE_Null_Mutex>::instance()
#endif

View File

@@ -29,18 +29,6 @@ endif()
# Group sources
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
add_library(worldserver-interface INTERFACE)
CollectIncludeDirectories(
${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC_INCLUDES
# Exclude
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
target_include_directories(worldserver-interface
INTERFACE
${PUBLIC_INCLUDES})
add_executable(worldserver
${PRIVATE_SOURCES})
@@ -57,19 +45,25 @@ endif()
set_target_properties(worldserver PROPERTIES LINK_FLAGS "${worldserver_LINK_FLAGS}")
CollectIncludeDirectories(
${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC_INCLUDES
# Exclude
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
target_include_directories(worldserver
PUBLIC
${PUBLIC_INCLUDES}
PRIVATE
${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(worldserver
PRIVATE
worldserver-interface
authserver-interface
game-interface
scripts-interface
PUBLIC
game
common
shared
scripts
gsoap
readline

View File

@@ -28,7 +28,6 @@
#include "TCSoap.h"
#include "Timer.h"
#include "Util.h"
#include "AuthSocket.h"
#include "RealmList.h"
#include "ScriptMgr.h"