@echo off
REM Build the Windows loopback capture tool.
REM Requires Visual Studio Build Tools (cl.exe) or MSVC.
REM Run from a "Developer Command Prompt for VS" or with vcvarsall.bat sourced.

cl /EHsc /O2 /Fe:loopback_capture.exe loopback_capture.cpp ole32.lib mfplat.lib
if %ERRORLEVEL% neq 0 (
    echo Build failed. Make sure you're running from a VS Developer Command Prompt.
    exit /b 1
)
echo Built loopback_capture.exe successfully.
echo Copy it to app-build\bin\loopback_capture.exe
if not exist ..\..\bin mkdir ..\..\bin
copy loopback_capture.exe ..\..\bin\loopback_capture.exe
echo Done.
