Build: Use git tag for file version on windows

This commit is contained in:
TheLastRar 2022-01-18 21:41:47 +00:00 committed by refractionpcsx2
parent 6ab69e5c1c
commit 7f2a9f6806
2 changed files with 19 additions and 5 deletions

View File

@ -55,6 +55,13 @@ if %ERRORLEVEL% NEQ 0 (
echo #define SVN_REV 0ll >> "%CD%\svnrev.h" echo #define SVN_REV 0ll >> "%CD%\svnrev.h"
echo #define GIT_REV "" >> "%CD%\svnrev.h" echo #define GIT_REV "" >> "%CD%\svnrev.h"
echo #define GIT_TAG "%GIT_TAG%" >> "%CD%\svnrev.h" echo #define GIT_TAG "%GIT_TAG%" >> "%CD%\svnrev.h"
for /F "tokens=1,2,3 delims=v." %%a in ("%GIT_TAG%") do (
echo #define GIT_TAG_HI %%a >> "%CD%\svnrev.h"
echo #define GIT_TAG_MID %%b >> "%CD%\svnrev.h"
echo #define GIT_TAG_LO %%c >> "%CD%\svnrev.h"
)
echo #define GIT_TAGGED_COMMIT 1 >> "%CD%\svnrev.h" echo #define GIT_TAGGED_COMMIT 1 >> "%CD%\svnrev.h"
) else ( ) else (
echo #define SVN_REV %REV%ll > "%CD%\svnrev.h" echo #define SVN_REV %REV%ll > "%CD%\svnrev.h"

View File

@ -14,10 +14,19 @@
*/ */
#pragma once #pragma once
#include "svnrev.h"
#define PCSX2_VersionHi 1 #define PCSX2_isReleaseVersion false
#define PCSX2_VersionMid 7
#define PCSX2_VersionLo 0 #if PCSX2_isReleaseVersion == false && GIT_TAGGED_COMMIT
#define PCSX2_VersionHi GIT_TAG_HI
#define PCSX2_VersionMid GIT_TAG_MID
#define PCSX2_VersionLo GIT_TAG_LO
#else
#define PCSX2_VersionHi 1
#define PCSX2_VersionMid 7
#define PCSX2_VersionLo 0
#endif
#define STRINGIZE2(s) #s #define STRINGIZE2(s) #s
#define STRINGIZE(s) STRINGIZE2(s) #define STRINGIZE(s) STRINGIZE2(s)
@ -36,8 +45,6 @@
#define VER_INTERNAL_NAME_STR VER_ORIGINAL_FILENAME_STR #define VER_INTERNAL_NAME_STR VER_ORIGINAL_FILENAME_STR
#define VER_COPYRIGHT_STR "Copyright (C) 2021" #define VER_COPYRIGHT_STR "Copyright (C) 2021"
static const bool PCSX2_isReleaseVersion = 0;
class SysCoreThread; class SysCoreThread;
class CpuInitializerSet; class CpuInitializerSet;