Skip to content

Commit

Permalink
Added build.bat to automate build process further
Browse files Browse the repository at this point in the history
Added `build.bat` which is a batch file that should automatically load the VS Developer Command Prompt when run, as well as build both architectures through the regular batch files.
  • Loading branch information
Aemony authored Apr 10, 2023
1 parent 634c3a4 commit 422a62e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@echo off

@REM Set to pause after a successful build process
set __SK_PAUSE_SUCCESS=0

@REM Set to allow using prerelease version of Visual Studio
set __SK_VS_PRERELEASE=0

@REM Call the VS Developer Command Prompt if not already done
IF NOT DEFINED VSCMD_VER (
IF %__SK_VS_PRERELEASE% EQU 1 (
@REM Use prerelease version
FOR /f "usebackq delims=" %%i IN (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease -latest -property installationPath`) DO (
IF EXIST "%%i\Common7\Tools\vsdevcmd.bat" (
call "%%i\Common7\Tools\vsdevcmd.bat"
goto :sk_continue
)
)
) ELSE (
@REM Use latest version
FOR /f "usebackq delims=" %%i IN (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) DO (
IF EXIST "%%i\Common7\Tools\vsdevcmd.bat" (
call "%%i\Common7\Tools\vsdevcmd.bat"
goto :sk_continue
)
)
)
)
:sk_continue

@REM Build Special K
cd /D "%~dp0"
call "%~dp0buildx86.bat"
call "%~dp0buildx64.bat"

@REM Post-build tasks
IF %ERRORLEVEL% EQU 0 (
IF %__SK_PAUSE_SUCCESS% EQU 1 (
@REM Pause even after a successful build process
pause
)
)

0 comments on commit 422a62e

Please sign in to comment.