Skip to content
Permalink
Browse files

Merge pull request #12037 from driver1998/master

Fix git-version-gen on normal commits (without tag)
  • Loading branch information...
hrydgard committed May 13, 2019
2 parents 712964f + c4f200e commit 974d8f5d13e7cea7be2b22196411f593ac0cdc29
Showing with 12 additions and 3 deletions.
  1. +1 −0 Common/ArmCPUDetect.cpp
  2. +11 −3 Windows/git-version-gen.cmd
  3. BIN Windows/version.rc
@@ -47,6 +47,7 @@ std::string GetCPUBrandString() {
cpu_string = ConvertWStringToUTF8((wchar_t*)buff);
free(buff);
}
RegCloseKey(key);
}

if (cpu_string.empty())
@@ -132,14 +132,22 @@ if exist "%WIN_VERSION_FILE%" (

set WIN_RELEASE_VERSION=0
set WIN_BUILD_NUMBER=0
for /f "tokens=1 delims=-" %%a in ("%GIT_VERSION:~1%") do set WIN_RELEASE_VERSION=%%a
for /f "tokens=2 delims=-" %%a in ("%GIT_VERSION%") do set WIN_BUILD_NUMBER=%%a

if /i "%GIT_VERSION:~0,1%" == "v" (
rem // Official releases with version tags
for /f "tokens=1 delims=-" %%a in ("%GIT_VERSION:~1%") do set WIN_RELEASE_VERSION=%%a
for /f "tokens=2 delims=-" %%a in ("%GIT_VERSION%") do set WIN_BUILD_NUMBER=%%a
set WIN_VERSION_COMMA=!WIN_RELEASE_VERSION:.=,!,!WIN_BUILD_NUMBER!
) else (
rem // Normal commits
set WIN_VERSION_COMMA=0,0,0x%GIT_VERSION:~0,4%,0x%GIT_VERSION:~4,4%
)

echo // This is a generated file, by git-version-gen.cmd. > "%WIN_VERSION_FILE%"
echo // GIT_VERSION=%GIT_VERSION% >> "%WIN_VERSION_FILE%"
echo. >> "%WIN_VERSION_FILE%"
echo #define PPSSPP_WIN_VERSION_STRING "%GIT_VERSION%" >> "%WIN_VERSION_FILE%"
echo #define PPSSPP_WIN_VERSION_COMMA %WIN_RELEASE_VERSION:.=,%,%WIN_BUILD_NUMBER% >> "%WIN_VERSION_FILE%"
echo #define PPSSPP_WIN_VERSION_COMMA %WIN_VERSION_COMMA% >> "%WIN_VERSION_FILE%"
echo. >> "%WIN_VERSION_FILE%"
echo // If you don't want this file to update/recompile, change to 1. >> "%WIN_VERSION_FILE%"
echo #define PPSSPP_WIN_VERSION_NO_UPDATE 0 >> "%WIN_VERSION_FILE%"
BIN +0 Bytes (100%) Windows/version.rc
Binary file not shown.

0 comments on commit 974d8f5

Please sign in to comment.
You can’t perform that action at this time.