Files
radar_data_process/.vscode/scripts/build_config.bat
T

50 lines
1.6 KiB
Batchfile

@echo off
rem ===========================================================================
rem Configure and build one build configuration (build type + record mode).
rem
rem Usage:
rem build_config.bat ^<Debug^|Release^> [AUTO^|ON^|OFF]
rem
rem Examples:
rem build_config.bat Release OFF
rem build_config.bat Debug ON
rem build_config.bat Release AUTO
rem
rem Runs configure.bat + build.bat for the same configuration:
rem build\<Debug^|Release^>\<REC_AUTO^|REC_OFF^|REC_ON^>
rem The mechanical-scanning and phase-scanning variants are merged into one
rem build; the scan mode is a runtime config item (TOML [radar_params] scan_mode).
rem The run stops at the first failure and returns non-zero.
rem
rem Encoding: keep this file ASCII-only (see msvc_env.bat).
rem ===========================================================================
setlocal EnableExtensions
set "BUILD_TYPE=%~1"
set "RECORD_MODE=%~2"
if not defined BUILD_TYPE goto :usage
if not defined RECORD_MODE set "RECORD_MODE=AUTO"
rem Validate + normalize the configuration once.
call "%~dp0config_paths.bat" "%BUILD_TYPE%" "%RECORD_MODE%"
if errorlevel 1 exit /b 1
echo.
echo [build_config] ==================== %BUILD_TYPE% / %RECORD_MODE% ====================
call "%~dp0configure.bat" "%BUILD_TYPE%" "%RECORD_MODE%"
if errorlevel 1 goto :failed
call "%~dp0build.bat" "%BUILD_TYPE%" "%RECORD_MODE%"
if errorlevel 1 goto :failed
echo.
echo [build_config] all done: %BUILD_TYPE% / %RECORD_MODE%
exit /b 0
:failed
echo.
echo [build_config] FAILED - stopped at the first failure, see the log above
exit /b 1
:usage
echo Usage: build_config.bat ^<Debug^|Release^> [AUTO^|ON^|OFF^]
exit /b 1