OSDN Git Service

Improved test script.
[slunkcrypt/SlunkCrypt.git] / mk-release.cmd
1 @echo off
2 setlocal enabledelayedexpansion
3
4 set ECHO="%~dp0.\etc\utils\win32\cecho.exe"
5 if "%MSVC_PATH%"=="" (
6         set "MSVC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC"
7 )
8
9 if not exist "%MSVC_PATH%\Auxiliary\Build\vcvarsall.bat" (
10         %ECHO% red "\nMSVC not found. Please check MSVC_PATH and try again^!\n"
11         pause
12         goto:eof
13 )
14
15 for %%p in (x86,x64,ARM64) do (
16         call "%MSVC_PATH%\Auxiliary\Build\vcvarsall.bat" %%p
17         for %%c in (Release,Release_SSE2,Release_DLL,Debug) do (
18                 if not "%%p::%%c"=="ARM64::Release_SSE2" (
19                         %ECHO% white "\n------------------------------------------------------------------------------"
20                         %ECHO% white "Clean [%%p:%%c]"
21                         %ECHO% white "------------------------------------------------------------------------------\n"
22                         MSBuild.exe /property:Configuration=%%c /property:Platform=%%p /target:Clean /verbosity:normal "%~dp0\Slunk.sln"
23                         if not "!ERRORLEVEL!"=="0" goto:BuildFailed
24                         %ECHO% white "\n------------------------------------------------------------------------------"
25                         %ECHO% white "Compile [%%p:%%c]"
26                         %ECHO% white "------------------------------------------------------------------------------\n"
27                         MSBuild.exe /property:Configuration=%%c /property:Platform=%%p /target:Build /verbosity:normal "%~dp0\Slunk.sln"
28                         if not "!ERRORLEVEL!"=="0" goto:BuildFailed
29                 )
30         )
31 )
32
33 %ECHO% green "\nBuild completed successfully.\n"
34 pause
35 goto:eof
36
37 :BuildFailed
38 %ECHO% red "\nBuild has failed ^!^!^!\n"
39 pause