Core/Build: Removed obsolete SystemConfig.h and made genrev be part of shared library, which allows cache hits to happen more likely

This commit is contained in:
StormBytePP
2015-08-16 16:56:11 +02:00
committed by Shauren
parent 90c9290761
commit 94f69fb1bc
21 changed files with 127 additions and 67 deletions

View File

@@ -91,6 +91,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})

View File

@@ -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().c_str(), 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().c_str(), 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().c_str());
_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;

View File

@@ -8,3 +8,4 @@
#include "TypeList.h"
#include "TaskScheduler.h"
#include "EventMap.h"
#include "Revision.h"

View File

@@ -0,0 +1,71 @@
#include "Revision.h"
#include "CompilerDefs.h"
#include "revision_data.h"
std::string Revision::GetPackageName()
{
return "TrinityCore";
}
std::string Revision::GetHash()
{
return _HASH;
}
std::string Revision::GetDate()
{
return _DATE;
}
std::string Revision::GetBranch()
{
return _BRANCH;
}
std::string Revision::GetSourceDirectory()
{
return _SOURCE_DIRECTORY;
}
std::string Revision::GetMySQLExecutable()
{
return _MYSQL_EXECUTABLE;
}
std::string Revision::GetFullDatabase()
{
return _FULL_DATABASE;
}
std::string Revision::GetFullVersion()
{
#if PLATFORM == PLATFORM_WINDOWS
# ifdef _WIN64
return GetPackageName() + " rev. " + VER_PRODUCTVERSION_STR + " (Win64, " + _BUILD_DIRECTIVE + ")";
# else
return GetPackageName() + " rev. " + VER_PRODUCTVERSION_STR + " (Win32, " + _BUILD_DIRECTIVE + ")";
# endif
#else
return GetPackageName() + " rev. " + VER_PRODUCTVERSION_STR + " (Unix, " + _BUILD_DIRECTIVE + ")";
#endif
}
std::string GetCompanyNameStr()
{
return VER_COMPANYNAME_STR;
}
std::string GetLegalCopyrightStr()
{
return VER_LEGALCOPYRIGHT_STR;
}
std::string GetFileVersionStr()
{
return VER_FILEVERSION_STR;
}
std::string GetProductVersionStr()
{
return VER_PRODUCTVERSION_STR;
}

View File

@@ -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
{
std::string GetPackageName();
std::string GetHash();
std::string GetDate();
std::string GetBranch();
std::string GetSourceDirectory();
std::string GetMySQLExecutable();
std::string GetFullDatabase();
std::string GetFullVersion();
std::string GetCompanyNameStr();
std::string GetLegalCopyrightStr();
std::string GetFileVersionStr();
std::string 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

View File

@@ -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<>