@echo off
@setlocal
pushd %~dp0

set exeName=slime.exe
set binDir=bin

mkdir build 2>nul
pushd build

taskkill /F /IM %exeName% > NUL 2> NUL

echo ---------- Compiling ----------
call timecmd cl ../src/main.cpp /std:c++latest /Fe%exeName% /W3 /Zi /nologo /EHsc /link /NODEFAULTLIB:libucrt libucrtd.lib

if %errorlevel% == 0 (
   echo.
   echo Done
   echo.
   pushd ..\bin
   call timecmd ..\build\slime.exe --run-tests
   popd
) else (
  echo.
  echo Fuckin' ell
)

popd
popd
