2026-04-09 22:52:30 +08:00

34 lines
669 B
Batchfile

@echo off
setlocal EnableExtensions
set "BUILD_CONFIG=Debug"
if not "%~1"=="" (
if /I "%~1"=="Debug" (
set "BUILD_CONFIG=Debug"
) else if /I "%~1"=="Release" (
set "BUILD_CONFIG=Release"
) else (
echo Usage: %~nx0 [Debug^|Release]
exit /b 1
)
)
echo === Building DetectBarIntersection [%BUILD_CONFIG%] ===
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
if errorlevel 1 (
echo CMake configuration failed!
exit /b %ERRORLEVEL%
)
cmake --build build --config %BUILD_CONFIG%
if errorlevel 1 (
echo Build failed!
exit /b %ERRORLEVEL%
)
echo === Build completed successfully [%BUILD_CONFIG%] ===