Windows: Move git-version update to build event.

Doing it on each project made it possible for two to overwrite each other.
It's rare, but this could corrupt git-version.cpp.

This makes it run when Core is resolved, and also on Windows/Headless only.
It may still require two compiles to update, but that's not a new problem.
This commit is contained in:
Unknown W. Brackets 2020-05-23 13:22:32 -07:00
parent 2a2584ec23
commit 9064bbcad1
8 changed files with 79 additions and 156 deletions

2
.gitignore vendored
View file

@ -29,6 +29,7 @@ Windows/ARM64
Windows/ipch
Windows/bin-release
Windows/win-version.h
Windows/win-version-*.tmp
android/assets
ext/_Output
android/lint.xml
@ -78,6 +79,7 @@ memstick*
Cheats
/git-version.cpp
/git-version-*.tmp
.pspsh.hist
__testoutput.txt

View file

@ -152,10 +152,6 @@
<Lib>
<AdditionalLibraryDirectories>Winmm.lib</AdditionalLibraryDirectories>
</Lib>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
@ -180,10 +176,6 @@
<Lib>
<AdditionalLibraryDirectories>Winmm.lib</AdditionalLibraryDirectories>
</Lib>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
@ -208,10 +200,6 @@
<Lib>
<AdditionalLibraryDirectories>Winmm.lib</AdditionalLibraryDirectories>
</Lib>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
@ -236,10 +224,6 @@
<Lib>
<AdditionalLibraryDirectories>Winmm.lib</AdditionalLibraryDirectories>
</Lib>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@ -269,10 +253,6 @@
<Lib>
<AdditionalLibraryDirectories>Winmm.lib</AdditionalLibraryDirectories>
</Lib>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@ -304,10 +284,6 @@
<Lib>
<AdditionalLibraryDirectories>Winmm.lib</AdditionalLibraryDirectories>
</Lib>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
@ -339,10 +315,6 @@
<Lib>
<AdditionalLibraryDirectories>Winmm.lib</AdditionalLibraryDirectories>
</Lib>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
@ -374,10 +346,6 @@
<Lib>
<AdditionalLibraryDirectories>Winmm.lib</AdditionalLibraryDirectories>
</Lib>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="ABI.h" />

View file

@ -129,7 +129,9 @@
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup>
<CustomBuildBeforeTargets>ResolveProjectReferences</CustomBuildBeforeTargets>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@ -147,10 +149,11 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<CustomBuildStep>
<Command>../Windows/git-version-gen.cmd</Command>
<Outputs>../git-version.cpp;%(Outputs)</Outputs>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
@ -170,10 +173,11 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<CustomBuildStep>
<Command>../Windows/git-version-gen.cmd</Command>
<Outputs>../git-version.cpp;%(Outputs)</Outputs>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
@ -193,10 +197,11 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<CustomBuildStep>
<Command>../Windows/git-version-gen.cmd</Command>
<Outputs>../git-version.cpp;%(Outputs)</Outputs>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
@ -217,10 +222,11 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<CustomBuildStep>
<Command>../Windows/git-version-gen.cmd</Command>
<Outputs>../git-version.cpp;%(Outputs)</Outputs>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@ -244,14 +250,14 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<CustomBuildStep />
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
<Lib>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
<CustomBuildStep>
<Command>../Windows/git-version-gen.cmd</Command>
<Outputs>../git-version.cpp;%(Outputs)</Outputs>
<Message>Updating git-version.cpp</Message>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@ -278,10 +284,11 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<CustomBuildStep>
<Command>../Windows/git-version-gen.cmd</Command>
<Outputs>../git-version.cpp;%(Outputs)</Outputs>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
@ -308,10 +315,11 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<CustomBuildStep>
<Command>../Windows/git-version-gen.cmd</Command>
<Outputs>../git-version.cpp;%(Outputs)</Outputs>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
@ -338,10 +346,11 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<CustomBuildStep>
<Command>../Windows/git-version-gen.cmd</Command>
<Outputs>../git-version.cpp;%(Outputs)</Outputs>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\ext\disarm.cpp" />

View file

@ -178,10 +178,6 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
@ -202,10 +198,6 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
@ -225,10 +217,6 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
@ -249,10 +237,6 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@ -276,10 +260,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@ -305,10 +285,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
@ -334,10 +310,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
@ -363,10 +335,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\ext\xbrz\xbrz.h" />

View file

@ -220,10 +220,6 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
@ -245,10 +241,6 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
@ -270,10 +262,6 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
@ -296,10 +284,6 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@ -325,10 +309,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@ -356,10 +336,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
@ -387,10 +363,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
@ -418,10 +390,6 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
<Command>../Windows/git-version-gen.cmd</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View file

@ -261,7 +261,7 @@
<AdditionalOptions>/ignore:4049 /ignore:4217 %(AdditionalOptions)</AdditionalOptions>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd PPSSPPWindows</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
@ -298,7 +298,7 @@
<SubSystem>Windows</SubSystem>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd PPSSPPWindows</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
@ -333,7 +333,7 @@
<SubSystem>Windows</SubSystem>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd PPSSPPWindows</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
@ -367,7 +367,7 @@
<SubSystem>Windows</SubSystem>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd PPSSPPWindows</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
@ -409,7 +409,7 @@
<GenerateMapFile>true</GenerateMapFile>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd PPSSPPWindows</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
<ResourceCompile>
@ -453,7 +453,7 @@
<LargeAddressAware>true</LargeAddressAware>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd PPSSPPWindows</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
<ResourceCompile>
@ -494,7 +494,7 @@
<LargeAddressAware>true</LargeAddressAware>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd PPSSPPWindows</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
<ResourceCompile>
@ -535,7 +535,7 @@
<LargeAddressAware>true</LargeAddressAware>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd PPSSPPWindows</Command>
<Message>Updating git-version.cpp</Message>
</PreBuildEvent>
<ResourceCompile>

View file

@ -25,7 +25,9 @@ rem // If git is not installed, "unknown" is the version.
setlocal ENABLEDELAYEDEXPANSION
set GIT_VERSION_FILE=%~p0..\git-version.cpp
set GIT_VERSION_TEMP=%~p0..\git-version-%1%RANDOM%.tmp
set WIN_VERSION_FILE=%~p0.\win-version.h
set WIN_VERSION_TEMP=%~p0.\win-version-%1%RANDOM%.tmp
set GIT_MISSING=0
if not defined GIT (
@ -78,28 +80,31 @@ if "%GIT_MISSING%" == "1" (
echo WARNING: Unable to update git-version.cpp, git not found.
echo If you don't want to add it to your path, set the GIT environment variable.
echo // This is a generated file, by git-version-gen.cmd. > "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo // ERROR: Unable to determine version - git not on path. > "%GIT_VERSION_FILE%"
echo const char *PPSSPP_GIT_VERSION = "unknown"; >> "%GIT_VERSION_FILE%"
echo // This is a generated file, by git-version-gen.cmd. > "%GIT_VERSION_TEMP%"
echo. >> "%GIT_VERSION_TEMP%"
echo // ERROR: Unable to determine version - git not on path. > "%GIT_VERSION_TEMP%"
echo const char *PPSSPP_GIT_VERSION = "unknown"; >> "%GIT_VERSION_TEMP%"
move /y "%GIT_VERSION_TEMP%" "%GIT_VERSION_FILE%" > NUL
goto gitdone
)
rem // Don't modify the file if it already has the current version.
if exist "%GIT_VERSION_FILE%" (
rem // Don't modify the file if it already has the current version.
findstr /C:"%GIT_VERSION%" "%GIT_VERSION_FILE%" > NUL
if not errorlevel 1 (
goto gitdone
)
)
echo // This is a generated file, by git-version-gen.cmd. > "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo const char *PPSSPP_GIT_VERSION = "%GIT_VERSION%"; >> "%GIT_VERSION_FILE%"
echo. >> "%GIT_VERSION_FILE%"
echo // If you don't want this file to update/recompile, change to 1. >> "%GIT_VERSION_FILE%"
echo #define PPSSPP_GIT_VERSION_NO_UPDATE 0 >> "%GIT_VERSION_FILE%"
echo // This is a generated file, by git-version-gen.cmd. > "%GIT_VERSION_TEMP%"
echo. >> "%GIT_VERSION_TEMP%"
echo const char *PPSSPP_GIT_VERSION = "%GIT_VERSION%"; >> "%GIT_VERSION_TEMP%"
echo. >> "%GIT_VERSION_TEMP%"
echo // If you don't want this file to update/recompile, change to 1. >> "%GIT_VERSION_TEMP%"
echo #define PPSSPP_GIT_VERSION_NO_UPDATE 0 >> "%GIT_VERSION_TEMP%"
move /y "%GIT_VERSION_TEMP%" "%GIT_VERSION_FILE%" > NUL
:gitdone
if exist "%WIN_VERSION_FILE%" (
@ -113,12 +118,13 @@ if exist "%WIN_VERSION_FILE%" (
if "%GIT_MISSING%" == "1" (
echo WARNING: Unable to update Windows/win-version.h, git not found.
echo // This is a generated file, by git-version-gen.cmd. > "%WIN_VERSION_FILE%"
echo. >> "%WIN_VERSION_FILE%"
echo // ERROR: Unable to determine version - git not on path. > "%WIN_VERSION_FILE%"
echo #define PPSSPP_WIN_VERSION_STRING "unknown" > "%WIN_VERSION_FILE%"
echo #define PPSSPP_WIN_VERSION_COMMA 0,0,0,0 > "%WIN_VERSION_FILE%"
echo // This is a generated file, by git-version-gen.cmd. > "%WIN_VERSION_TEMP%"
echo. >> "%WIN_VERSION_TEMP%"
echo // ERROR: Unable to determine version - git not on path. > "%WIN_VERSION_TEMP%"
echo #define PPSSPP_WIN_VERSION_STRING "unknown" > "%WIN_VERSION_TEMP%"
echo #define PPSSPP_WIN_VERSION_COMMA 0,0,0,0 > "%WIN_VERSION_TEMP%"
move /y "%WIN_VERSION_TEMP%" "%WIN_VERSION_FILE%" > NUL
goto done
)
@ -143,13 +149,15 @@ if /i "%GIT_VERSION:~0,1%" == "v" (
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_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%"
echo // This is a generated file, by git-version-gen.cmd. > "%WIN_VERSION_TEMP%"
echo // GIT_VERSION=%GIT_VERSION% >> "%WIN_VERSION_TEMP%"
echo. >> "%WIN_VERSION_TEMP%"
echo #define PPSSPP_WIN_VERSION_STRING "%GIT_VERSION%" >> "%WIN_VERSION_TEMP%"
echo #define PPSSPP_WIN_VERSION_COMMA %WIN_VERSION_COMMA% >> "%WIN_VERSION_TEMP%"
echo. >> "%WIN_VERSION_TEMP%"
echo // If you don't want this file to update/recompile, change to 1. >> "%WIN_VERSION_TEMP%"
echo #define PPSSPP_WIN_VERSION_NO_UPDATE 0 >> "%WIN_VERSION_TEMP%"
move /y "%WIN_VERSION_TEMP%" "%WIN_VERSION_FILE%" > NUL
:done

View file

@ -198,7 +198,7 @@
<AdditionalLibraryDirectories>../ffmpeg/Windows/x86/lib</AdditionalLibraryDirectories>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd Headless</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
@ -231,7 +231,7 @@
<AdditionalLibraryDirectories>../ffmpeg/Windows/x86_64/lib</AdditionalLibraryDirectories>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd Headless</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
@ -261,7 +261,7 @@
<AdditionalLibraryDirectories>../ffmpeg/Windows/aarch64/lib</AdditionalLibraryDirectories>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd Headless</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
@ -292,7 +292,7 @@
<AdditionalLibraryDirectories>../ffmpeg/Windows/arm/lib</AdditionalLibraryDirectories>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd Headless</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
@ -328,7 +328,7 @@
<AdditionalLibraryDirectories>../ffmpeg/Windows/x86/lib</AdditionalLibraryDirectories>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd Headless</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
@ -366,7 +366,7 @@
<AdditionalLibraryDirectories>../ffmpeg/Windows/x86_64/lib</AdditionalLibraryDirectories>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd Headless</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
@ -401,7 +401,7 @@
<AdditionalLibraryDirectories>../ffmpeg/Windows/aarch64/lib</AdditionalLibraryDirectories>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd Headless</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>
@ -436,7 +436,7 @@
<AdditionalLibraryDirectories>../ffmpeg/Windows/arm/lib</AdditionalLibraryDirectories>
</Link>
<PreBuildEvent>
<Command>../Windows/git-version-gen.cmd</Command>
<Command>../Windows/git-version-gen.cmd Headless</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Updating git-version.cpp</Message>