2 setlocal EnableExtensions
5 if /I "%~1"=="clean" goto clean
7 if not exist "config.h" (
8 echo [ERROR] config.h is missing from the source root.
9 echo Please extract the full source ZIP before building.
13 findstr /n /c:"#define snprintf" "%~dp0libmultihash\multihash.h" "%~dp0libfriidump\win32compat.h" >nul 2>nul
15 echo [ERROR] Legacy snprintf macro still present. Overwrite libmultihash\multihash.h and libfriidump\win32compat.h from this package.
20 if not exist "build-msvc32" mkdir "build-msvc32"
22 call "%~dp0.vscode\msvc32.cmd" cl @"%~dp0msvc32_friidump.rsp"
23 if errorlevel 1 exit /b %ERRORLEVEL%
25 set "HELP_LOG=%TEMP%\friidump-help-%RANDOM%-%RANDOM%.txt"
26 "%~dp0friidump.exe" --help > "%HELP_LOG%" 2>&1
29 findstr /c:"FriiDump " "%HELP_LOG%" >nul
31 echo [ERROR] FriiDump help/version smoke test failed.
32 del /q "%HELP_LOG%" >nul 2>nul
33 if exist "friidump.log" del /q "friidump.log"
37 findstr /c:"Available command line options:" "%HELP_LOG%" >nul
39 echo [ERROR] FriiDump command-line help smoke test failed.
40 del /q "%HELP_LOG%" >nul 2>nul
41 if exist "friidump.log" del /q "friidump.log"
45 del /q "%HELP_LOG%" >nul 2>nul
46 if exist "friidump.log" del /q "friidump.log"
48 powershell -NoProfile -ExecutionPolicy Bypass -Command "Compress-Archive -Force -Path friidump.exe,docs,README,AUTHORS,COPYING,config.h,msvc32_friidump.rsp,build_msvc32.cmd,.vscode -DestinationPath friidump_msvc32_build_results.zip"
52 if exist "friidump.exe" del /q "friidump.exe"
53 if exist "build-msvc32" rmdir /s /q "build-msvc32"
54 if exist "friidump_msvc32_build_results.zip" del /q "friidump_msvc32_build_results.zip"
55 if exist "friidump.log" del /q "friidump.log"