@echo off setlocal set "CONFIG=%~1" if "%CONFIG%"=="" set "CONFIG=Debug" set "REPO_ROOT=%~dp0..\.." for %%I in ("%REPO_ROOT%") do set "REPO_ROOT=%%~fI" set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" if not exist "%VSWHERE%" ( echo vswhere.exe was not found at "%VSWHERE%". exit /b 2 ) for /f "usebackq delims=" %%I in (`"%VSWHERE%" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSINSTALL=%%I" if "%VSINSTALL%"=="" ( echo Visual Studio with MSVC x64 tools was not found. exit /b 2 ) set "VCVARS=%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" if not exist "%VCVARS%" ( echo vcvars64.bat was not found at "%VCVARS%". exit /b 2 ) call "%VCVARS%" || exit /b 2 cd /d "%REPO_ROOT%" || exit /b 2 set "BUILD_DIR=rebuild/remorse/out/build-nmake" cmake -S rebuild/remorse -B "%BUILD_DIR%" -G "NMake Makefiles" -DCMAKE_BUILD_TYPE="%CONFIG%" || exit /b 1 cmake --build "%BUILD_DIR%" || exit /b 1 ctest --test-dir "%BUILD_DIR%" --output-on-failure || exit /b 1 set "EXE=%BUILD_DIR%\remorse_rebuild.exe" if not exist "%EXE%" ( echo Built executable was not found at "%EXE%". exit /b 1 ) "%EXE%" exports\src_remorse\export_manifest.json || exit /b 1