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
+1
View File
@@ -16,6 +16,7 @@ set(winDebugging
${CMAKE_SOURCE_DIR}/src/common/Debugging/WheatyExceptionReport.h) ${CMAKE_SOURCE_DIR}/src/common/Debugging/WheatyExceptionReport.h)
endif() endif()
add_subdirectory(shared)
add_subdirectory(game) add_subdirectory(game)
add_subdirectory(authserver) add_subdirectory(authserver)
add_subdirectory(scripts) add_subdirectory(scripts)
+10 -16
View File
@@ -31,18 +31,6 @@ endif()
# Group sources # Group sources
GroupSources(${CMAKE_CURRENT_SOURCE_DIR}) 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 add_executable(authserver
${PRIVATE_SOURCES}) ${PRIVATE_SOURCES})
@@ -54,18 +42,24 @@ if(NOT WIN32)
endif() endif()
target_link_libraries(authserver target_link_libraries(authserver
PRIVATE
authserver-interface
PUBLIC PUBLIC
common) shared)
CollectIncludeDirectories(
${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC_INCLUDES
# Exclude
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
target_include_directories(authserver target_include_directories(authserver
PUBLIC
${PUBLIC_INCLUDES}
PRIVATE PRIVATE
${CMAKE_CURRENT_BINARY_DIR}) ${CMAKE_CURRENT_BINARY_DIR})
set_target_properties(authserver set_target_properties(authserver
PROPERTIES PROPERTIES
FOLDER FOLDER
"server") "server")
if( WIN32 ) if( WIN32 )
+32
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")
@@ -6,9 +6,9 @@
#include "Common.h" #include "Common.h"
#include "RealmList.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 // Load the realm list from the database
void RealmList::Initialize(uint32 updateInterval) void RealmList::Initialize(uint32 updateInterval)
@@ -70,4 +70,5 @@ private:
}; };
#define sRealmList ACE_Singleton<RealmList, ACE_Null_Mutex>::instance() #define sRealmList ACE_Singleton<RealmList, ACE_Null_Mutex>::instance()
#endif #endif
+9 -15
View File
@@ -29,18 +29,6 @@ endif()
# Group sources # Group sources
GroupSources(${CMAKE_CURRENT_SOURCE_DIR}) 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 add_executable(worldserver
${PRIVATE_SOURCES}) ${PRIVATE_SOURCES})
@@ -57,19 +45,25 @@ endif()
set_target_properties(worldserver PROPERTIES LINK_FLAGS "${worldserver_LINK_FLAGS}") 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 target_include_directories(worldserver
PUBLIC
${PUBLIC_INCLUDES}
PRIVATE PRIVATE
${CMAKE_CURRENT_BINARY_DIR}) ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(worldserver target_link_libraries(worldserver
PRIVATE PRIVATE
worldserver-interface
authserver-interface
game-interface game-interface
scripts-interface scripts-interface
PUBLIC PUBLIC
game game
common shared
scripts scripts
gsoap gsoap
readline readline
-1
View File
@@ -28,7 +28,6 @@
#include "TCSoap.h" #include "TCSoap.h"
#include "Timer.h" #include "Timer.h"
#include "Util.h" #include "Util.h"
#include "AuthSocket.h"
#include "RealmList.h" #include "RealmList.h"
#include "ScriptMgr.h" #include "ScriptMgr.h"