@echo off
REM ============================================================
REM  Build the interactive ISQL shell (links isqldll.dll).
REM  Run:  examples\build_shell.bat
REM  Requires: MSVC x64 build tools (located automatically).
REM  The exe is placed in bin\ , beside isqldll.dll.
REM ============================================================
setlocal
call "%~dp0findvc.bat" || exit /b 1
call "%VCVARS%" >nul
set ROOT=%~dp0..

cl /nologo /MD /W3 /O2 ^
   /D WIN32 /D _CRT_SECURE_NO_WARNINGS /D _CRT_NONSTDC_NO_WARNINGS ^
   /I"%ROOT%\include\h" ^
   "%ROOT%\examples\isql_shell.c" ^
   "%ROOT%\lib\isqldll.lib" ^
   /Fe"%ROOT%\bin\isql_shell.exe"

if errorlevel 1 ( echo BUILD FAILED & exit /b 1 )
echo.
echo Built: %ROOT%\bin\isql_shell.exe
echo Run:   "%ROOT%\bin\isql_shell.exe" "%ROOT%"
endlocal
