From 082cef5bb08504110d5e08fe5a90bba4e3aa4059 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sat, 14 May 2022 03:54:21 +0800 Subject: [PATCH] =?UTF-8?q?perf.=E4=BB=A5=E4=B8=80=E7=A7=8D=E6=9B=B4?= =?UTF-8?q?=E5=8A=A0=E4=BC=98=E9=9B=85=E7=9A=84=E6=96=B9=E5=BC=8F=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAssistant/MeoAssistant.vcxproj | 2 +- src/MeoAssistant/Version.h | 7 ++++++- tools/build_release.bat | 2 +- tools/version.sh | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/MeoAssistant/MeoAssistant.vcxproj b/src/MeoAssistant/MeoAssistant.vcxproj index 1bf1ec98b3..57301506fc 100644 --- a/src/MeoAssistant/MeoAssistant.vcxproj +++ b/src/MeoAssistant/MeoAssistant.vcxproj @@ -248,7 +248,7 @@ stdc11 MultiThreaded MaxSpeed - /utf-8 /MP %(AdditionalOptions) + /utf-8 /MP $(ExternalCompilerOptions) %(AdditionalOptions) true diff --git a/src/MeoAssistant/Version.h b/src/MeoAssistant/Version.h index de415f9699..c24e3b7c70 100644 --- a/src/MeoAssistant/Version.h +++ b/src/MeoAssistant/Version.h @@ -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 } diff --git a/tools/build_release.bat b/tools/build_release.bat index e00d15e635..ebafb944ae 100644 --- a/tools/build_release.bat +++ b/tools/build_release.bat @@ -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 diff --git a/tools/version.sh b/tools/version.sh index f85663a5f9..d3610e1d10 100644 --- a/tools/version.sh +++ b/tools/version.sh @@ -9,4 +9,4 @@ else Version="c""$LatestCommitId" fi -echo "Version: $Version" +echo "$Version"