mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Build: Removed obsolete SystemConfig.h and made genrev be part of shared library, which allows cache hits to happen more likely
(cherry picked from commit 94f69fb1bc)
This commit is contained in:
@@ -94,6 +94,8 @@ add_library(shared STATIC
|
||||
${shared_STAT_PCH_SRC}
|
||||
)
|
||||
|
||||
add_dependencies(shared revision_data.h)
|
||||
|
||||
# Generate precompiled header
|
||||
if (USE_COREPCH)
|
||||
add_cxx_pch(shared ${shared_STAT_PCH_HDR} ${shared_STAT_PCH_SRC})
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
#include "WheatyExceptionReport.h"
|
||||
|
||||
#include "Common.h"
|
||||
#include "SystemConfig.h"
|
||||
#include "revision.h"
|
||||
#include "Revision.h"
|
||||
|
||||
#define CrashFolder _T("Crashes")
|
||||
#pragma comment(linker, "/DEFAULTLIB:dbghelp.lib")
|
||||
@@ -131,10 +130,10 @@ PEXCEPTION_POINTERS pExceptionInfo)
|
||||
SYSTEMTIME systime;
|
||||
GetLocalTime(&systime);
|
||||
sprintf(m_szDumpFileName, "%s\\%s_%s_[%u-%u_%u-%u-%u].dmp",
|
||||
crash_folder_path, _HASH, pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond);
|
||||
crash_folder_path, Revision::GetHash(), pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond);
|
||||
|
||||
sprintf(m_szLogFileName, "%s\\%s_%s_[%u-%u_%u-%u-%u].txt",
|
||||
crash_folder_path, _HASH, pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond);
|
||||
crash_folder_path, Revision::GetHash(), pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond);
|
||||
|
||||
m_hDumpFile = CreateFile(m_szDumpFileName,
|
||||
GENERIC_WRITE,
|
||||
@@ -440,7 +439,7 @@ PEXCEPTION_POINTERS pExceptionInfo)
|
||||
GetLocalTime(&systime);
|
||||
|
||||
// Start out with a banner
|
||||
_tprintf(_T("Revision: %s\r\n"), _FULLVERSION);
|
||||
_tprintf(_T("Revision: %s\r\n"), Revision::GetFullVersion());
|
||||
_tprintf(_T("Date %u:%u:%u. Time %u:%u \r\n"), systime.wDay, systime.wMonth, systime.wYear, systime.wHour, systime.wMinute);
|
||||
PEXCEPTION_RECORD pExceptionRecord = pExceptionInfo->ExceptionRecord;
|
||||
|
||||
|
||||
@@ -107,7 +107,6 @@ class Appender
|
||||
|
||||
uint8 id;
|
||||
std::string name;
|
||||
AppenderType type;
|
||||
LogLevel level;
|
||||
AppenderFlags flags;
|
||||
};
|
||||
|
||||
@@ -8,3 +8,4 @@
|
||||
#include "TypeList.h"
|
||||
#include "TaskScheduler.h"
|
||||
#include "EventMap.h"
|
||||
#include "Revision.h"
|
||||
|
||||
73
src/server/shared/Revision.cpp
Normal file
73
src/server/shared/Revision.cpp
Normal file
@@ -0,0 +1,73 @@
|
||||
#include "Revision.h"
|
||||
#include "CompilerDefs.h"
|
||||
#include "revision_data.h"
|
||||
|
||||
char const* Revision::GetHash()
|
||||
{
|
||||
return _HASH;
|
||||
}
|
||||
|
||||
char const* Revision::GetDate()
|
||||
{
|
||||
return _DATE;
|
||||
}
|
||||
|
||||
char const* Revision::GetBranch()
|
||||
{
|
||||
return _BRANCH;
|
||||
}
|
||||
|
||||
char const* Revision::GetSourceDirectory()
|
||||
{
|
||||
return _SOURCE_DIRECTORY;
|
||||
}
|
||||
|
||||
char const* Revision::GetMySQLExecutable()
|
||||
{
|
||||
return _MYSQL_EXECUTABLE;
|
||||
}
|
||||
|
||||
char const* Revision::GetFullDatabase()
|
||||
{
|
||||
return _FULL_DATABASE;
|
||||
}
|
||||
|
||||
char const* Revision::GetHotfixesDatabase()
|
||||
{
|
||||
return _HOTFIXES_DATABASE;
|
||||
}
|
||||
|
||||
#define _PACKAGENAME "TrinityCore"
|
||||
|
||||
char const* Revision::GetFullVersion()
|
||||
{
|
||||
#if PLATFORM == PLATFORM_WINDOWS
|
||||
# ifdef _WIN64
|
||||
return _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Win64, " _BUILD_DIRECTIVE ")";
|
||||
# else
|
||||
return _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Win32, " _BUILD_DIRECTIVE ")";
|
||||
# endif
|
||||
#else
|
||||
return _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Unix, " _BUILD_DIRECTIVE ")";
|
||||
#endif
|
||||
}
|
||||
|
||||
char const* GetCompanyNameStr()
|
||||
{
|
||||
return VER_COMPANYNAME_STR;
|
||||
}
|
||||
|
||||
char const* GetLegalCopyrightStr()
|
||||
{
|
||||
return VER_LEGALCOPYRIGHT_STR;
|
||||
}
|
||||
|
||||
char const* GetFileVersionStr()
|
||||
{
|
||||
return VER_FILEVERSION_STR;
|
||||
}
|
||||
|
||||
char const* GetProductVersionStr()
|
||||
{
|
||||
return VER_PRODUCTVERSION_STR;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@@ -16,29 +15,25 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// THIS FILE IS DEPRECATED
|
||||
#ifndef __REVISION_H__
|
||||
#define __REVISION_H__
|
||||
|
||||
#ifndef TRINITY_SYSTEMCONFIG_H
|
||||
#define TRINITY_SYSTEMCONFIG_H
|
||||
#include <string>
|
||||
|
||||
#include "Define.h"
|
||||
#include "revision.h"
|
||||
namespace Revision
|
||||
{
|
||||
char const* GetHash();
|
||||
char const* GetDate();
|
||||
char const* GetBranch();
|
||||
char const* GetSourceDirectory();
|
||||
char const* GetMySQLExecutable();
|
||||
char const* GetFullDatabase();
|
||||
char const* GetHotfixesDatabase();
|
||||
char const* GetFullVersion();
|
||||
char const* GetCompanyNameStr();
|
||||
char const* GetLegalCopyrightStr();
|
||||
char const* GetFileVersionStr();
|
||||
char const* GetProductVersionStr();
|
||||
}
|
||||
|
||||
#define _PACKAGENAME "TrinityCore"
|
||||
|
||||
#if TRINITY_ENDIAN == TRINITY_BIGENDIAN
|
||||
# define _ENDIAN_STRING "big-endian"
|
||||
#else
|
||||
# define _ENDIAN_STRING "little-endian"
|
||||
#endif
|
||||
|
||||
#if PLATFORM == PLATFORM_WINDOWS
|
||||
# ifdef _WIN64
|
||||
# define _FULLVERSION _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Win64, " _BUILD_DIRECTIVE ")"
|
||||
# else
|
||||
# define _FULLVERSION _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Win32, " _BUILD_DIRECTIVE ")"
|
||||
# endif
|
||||
#else
|
||||
# define _FULLVERSION _PACKAGENAME " rev. " VER_PRODUCTVERSION_STR " (Unix, " _BUILD_DIRECTIVE ")"
|
||||
#endif
|
||||
#endif
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "DBUpdater.h"
|
||||
#include "Log.h"
|
||||
#include "revision.h"
|
||||
#include "Revision.h"
|
||||
#include "UpdateFetcher.h"
|
||||
#include "DatabaseLoader.h"
|
||||
#include "Config.h"
|
||||
@@ -40,7 +40,7 @@ std::string DBUpdater<T>::GetSourceDirectory()
|
||||
if (!entry.empty())
|
||||
return entry;
|
||||
else
|
||||
return _SOURCE_DIRECTORY;
|
||||
return Revision::GetSourceDirectory();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -50,7 +50,7 @@ std::string DBUpdater<T>::GetMySqlCli()
|
||||
if (!entry.empty())
|
||||
return entry;
|
||||
else
|
||||
return _MYSQL_EXECUTABLE;
|
||||
return Revision::GetMySQLExecutable();
|
||||
}
|
||||
|
||||
// Auth Database
|
||||
@@ -95,7 +95,7 @@ std::string DBUpdater<WorldDatabaseConnection>::GetTableName()
|
||||
template<>
|
||||
std::string DBUpdater<WorldDatabaseConnection>::GetBaseFile()
|
||||
{
|
||||
return _FULL_DATABASE;
|
||||
return Revision::GetFullDatabase();
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -153,7 +153,7 @@ std::string DBUpdater<HotfixDatabaseConnection>::GetTableName()
|
||||
template<>
|
||||
std::string DBUpdater<HotfixDatabaseConnection>::GetBaseFile()
|
||||
{
|
||||
return _HOTFIXES_DATABASE;
|
||||
return Revision::GetHotfixesDatabase();
|
||||
}
|
||||
|
||||
template<>
|
||||
|
||||
Reference in New Issue
Block a user