perf.以一种更加优雅的方式生成版本号

This commit is contained in:
MistEO
2022-05-14 03:54:21 +08:00
parent e32f423bec
commit 082cef5bb0
4 changed files with 9 additions and 4 deletions

View File

@@ -248,7 +248,7 @@
<LanguageStandard_C>stdc11</LanguageStandard_C>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<Optimization>MaxSpeed</Optimization>
<AdditionalOptions>/utf-8 /MP %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/utf-8 /MP $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>

View File

@@ -2,5 +2,10 @@
namespace asst
{
constexpr static const char* Version = "DEBUG VERSION";
constexpr static const char* Version =
#ifdef MAA_VERSION
MAA_VERSION;
#else
"DEBUG VERSION";
#endif
}

View File

@@ -1,4 +1,4 @@
sh ./update_version.sh
for /f "delims=" %%i in ('sh ./version.sh') do set ExternalCompilerOptions=/DMAA_VERSION=\"%%i\"
MSBuild.exe ..\MeoAssistantArknights.sln /p:Configuration=Release /p:Platform=x64 /t:Rebuild
call .\update_resource_rel.bat
pause

View File

@@ -9,4 +9,4 @@ else
Version="c""$LatestCommitId"
fi
echo "Version: $Version"
echo "$Version"