2020-12-05 10:37:53 +03:00
|
|
|
@ECHO OFF
|
|
|
|
SETLOCAL ENABLEDELAYEDEXPANSION
|
2022-05-12 02:51:59 +03:00
|
|
|
IF DEFINED VSINSTALLDIR GOTO :VSDEV_CMD
|
2023-02-07 05:23:56 +03:00
|
|
|
set _VSFINDER=%~dp0tools\get_vsdevcmd.ps1
|
|
|
|
for /f "tokens=* USEBACKQ" %%i in (
|
|
|
|
`powershell -NoProfile -ExecutionPolicy Bypass -File "%_VSFINDER%"`) do call "%%i"
|
2020-12-05 10:37:53 +03:00
|
|
|
|
2023-02-07 05:23:56 +03:00
|
|
|
IF NOT DEFINED VSINSTALLDIR GOTO :NOT_FOUND
|
2022-05-12 02:51:59 +03:00
|
|
|
|
2023-03-09 02:00:01 +03:00
|
|
|
IF "%1" == "-A" GOTO :VSDEV_CMD
|
|
|
|
set GEN_PLATFORM=-A x64
|
|
|
|
|
2022-05-12 02:51:59 +03:00
|
|
|
:VSDEV_CMD
|
|
|
|
set GENERATOR="Visual Studio 16 2019"
|
|
|
|
IF "%VisualStudioVersion:~0,2%" == "16" GOTO :START_BUILD
|
|
|
|
set GENERATOR="Visual Studio 17 2022"
|
|
|
|
|
|
|
|
:START_BUILD
|
2022-08-04 20:13:17 +03:00
|
|
|
set cmake_exe="%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
|
2020-10-20 22:53:14 +03:00
|
|
|
mkdir .\out\Windows\ 2>NUL
|
2023-03-09 02:00:01 +03:00
|
|
|
%cmake_exe% -G %GENERATOR% %GEN_PLATFORM% %* -B out\Windows -S .
|
2020-12-05 10:37:53 +03:00
|
|
|
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
|
2022-08-04 20:13:17 +03:00
|
|
|
%cmake_exe% --build out\Windows --config RelWithDebInfo
|
2020-12-05 10:37:53 +03:00
|
|
|
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
|
|
|
|
GOTO :EOF
|
|
|
|
|
|
|
|
:NOT_FOUND
|
2022-08-02 20:09:35 +03:00
|
|
|
ECHO "No Microsoft Visual Studio installation found!"
|
|
|
|
ECHO " Please run build from Developer Command Prompt"
|
2020-12-05 10:37:53 +03:00
|
|
|
EXIT /B 1
|
|
|
|
|
|
|
|
ENDLOCAL
|