45 lines
1.3 KiB
Batchfile
45 lines
1.3 KiB
Batchfile
@echo off
|
|
rem ===========================================================================
|
|
rem CMake build script (MSVC 2022 / v143, C++17, x64)
|
|
rem
|
|
rem Usage:
|
|
rem build.bat ^<PHASE_SCANNING^|MECHANICAL_SCANNING^> ^<Debug^|Release^> [AUTO^|ON^|OFF]
|
|
rem
|
|
rem Examples:
|
|
rem build.bat PHASE_SCANNING Release OFF
|
|
rem build.bat MECHANICAL_SCANNING Debug ON
|
|
rem
|
|
rem The build tree must have been configured by configure.bat first (same
|
|
rem configuration tuple):
|
|
rem build\<X256_PS^|X256_MS^>\<Debug^|Release^>\<REC_AUTO^|REC_OFF^|REC_ON^>
|
|
rem
|
|
rem Encoding: keep this file ASCII-only (see msvc_env.bat).
|
|
rem ===========================================================================
|
|
setlocal
|
|
if "%~1"=="" goto :usage
|
|
if "%~2"=="" goto :usage
|
|
|
|
call "%~dp0config_paths.bat" "%~1" "%~2" "%~3"
|
|
if errorlevel 1 exit /b 1
|
|
|
|
rem Load the MSVC 2022 environment (vcvarsall.bat + cl.exe existence check).
|
|
call "%~dp0msvc_env.bat"
|
|
if errorlevel 1 exit /b 1
|
|
|
|
pushd "%~dp0..\.."
|
|
if not exist "%BUILD_DIR%\CMakeCache.txt" (
|
|
echo [ERROR] "%BUILD_DIR%" is not configured - run configure.bat first
|
|
popd
|
|
exit /b 1
|
|
)
|
|
|
|
echo [build] %BUILD_DIR%
|
|
cmake --build "%BUILD_DIR%"
|
|
set "CMAKE_EXIT=%errorlevel%"
|
|
popd
|
|
exit /b %CMAKE_EXIT%
|
|
|
|
:usage
|
|
echo Usage: build.bat ^<PHASE_SCANNING^|MECHANICAL_SCANNING^> ^<Debug^|Release^> [AUTO^|ON^|OFF^]
|
|
exit /b 1
|