You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
834 B
Batchfile

@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
REM This script expects to be run from the parent directory
REM ex. scripts/build.bat
REM Sets the escape char. see for info:
REM https://stackoverflow.com/questions/55891318/how-to-echo-with-different-colors-in-the-windows-command-line-inside-a-for-loop
for /F %%a in ('echo prompt $E ^| cmd') do set "ESC=%%a"
IF not exist build/ (
echo This script needs to be run from the directory above build/
goto END
)
cmake --build build/ --target all
SET BUILD_ERRORLEVEL=!ERRORLEVEL!
IF NOT "!BUILD_ERRORLEVEL!"=="0" (
echo %ESC%[91mBUILD FAILED!%ESC%[0m %BUILD_ERRORLEVEL%
EXIT /B !BUILD_ERRORLEVEL!
)
IF not exist build/bin/shaders (
mkdir build/bin/shaders
)
REM TODO: Run any extra tasks here
echo %ESC%[92mBUILD SUCCEEDED!%ESC%[0m
:END
ENDLOCAL