Skip to content
Extraits de code Groupes Projets
Valider 15fb8e8f rédigé par Niels Martin Hansen's avatar Niels Martin Hansen
Parcourir les fichiers

"New", nicer solution for including the SVN revision information in Windows builds.

Originally committed to SVN as r1170.
parent b22a47f8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
// This file is intended as a template for the TortoiseSVN tool SubWCRev
// Set up your project so it runs a command similar to this as pre-build event:
//"C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" "$(SolutionDir)../aegisub" "$(SolutionDir)../aegisub/build/svn-revision-base.h" "$(SolutionDir)../aegisub/build/svn-revision.h"
// Of course make sure the relative paths etc. match your system
// Do not add or commit the resulting file to SVN.
#define BUILD_SVN_REVISION $WCREV$
#define BUILD_SVN_DATE "$WCDATE$"
#define BUILD_SVN_LOCALMODS $WCMODS?true:false$
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
#define BUILD_TIMESTAMP _T_rec(__DATE__) _T(" ") _T_rec(__TIME__) #define BUILD_TIMESTAMP _T_rec(__DATE__) _T(" ") _T_rec(__TIME__)
// If the BUILD_SVN_REVISION happens to be negative, the build is assumed to be a public-release build (ie. not prerel) // Define FINAL_RELEASE to mark a build as a "final" version, ie. not pre-release version
// So manually edit build/svn-revision.h to match that, when doing such a build, or add some other magic to do that. // In that case it won't include the SVN revision information
struct VersionInfoStruct { struct VersionInfoStruct {
// Some raw data // Some raw data
...@@ -87,17 +87,29 @@ struct VersionInfoStruct { ...@@ -87,17 +87,29 @@ struct VersionInfoStruct {
IsDebug = false; IsDebug = false;
#endif #endif
SvnRev = BUILD_SVN_REVISION; SvnRev = BUILD_SVN_REVISION;
#ifdef BUILD_SVN_DATE
BuildTime = _T_rec(BUILD_SVN_DATE);
#else
BuildTime = BUILD_TIMESTAMP; BuildTime = BUILD_TIMESTAMP;
#endif
BuildCredit = _T_rec(BUILD_CREDIT); BuildCredit = _T_rec(BUILD_CREDIT);
if (SvnRev > 0) if (SvnRev > 0) {
SCMStr = wxString::Format(_T("SVN r%d"), SvnRev); SCMStr = wxString::Format(_T("SVN r%d"), SvnRev);
#ifdef BUILD_SVN_LOCALMODS
SCMStr += BUILD_SVN_LOCALMODS ? _T("M") : _T("");
#endif
#ifdef BUILD_DARCS #ifdef BUILD_DARCS
else } else {
SCMStr = _T("darcs"); SCMStr = _T("darcs");
#endif #endif
}
IsRelease = SvnRev < 0; #ifdef FINAL_RELEASE
IsRelease = true;
#else
IsRelease = false;
#endif
VersionStr = wxString::Format(_T("%s%s"), VersionNumber, IsRelease ? _T("") : _T(" PRE-RELEASE")); VersionStr = wxString::Format(_T("%s%s"), VersionNumber, IsRelease ? _T("") : _T(" PRE-RELEASE"));
LongVersionString = wxString::Format(_T("%s (%s%s, %s)"), VersionStr.c_str(), IsDebug ? _T("debug, ") : _T(""), SCMStr.c_str(), BuildCredit); LongVersionString = wxString::Format(_T("%s (%s%s, %s)"), VersionStr.c_str(), IsDebug ? _T("debug, ") : _T(""), SCMStr.c_str(), BuildCredit);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter