Vendored
+31
-9
@@ -2,21 +2,43 @@
|
||||
rem ===========================================================================
|
||||
rem CMake build script (MSVC 2022 / v143, C++17, x64)
|
||||
rem
|
||||
rem Usage: build.bat <build-dir>
|
||||
rem e.g. build.bat build\X256_PS
|
||||
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
|
||||
set "BUILD_DIR=%~1"
|
||||
if "%BUILD_DIR%"=="" (
|
||||
echo Usage: build.bat ^<build-dir^>
|
||||
exit /b 1
|
||||
)
|
||||
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 %errorlevel%
|
||||
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%"
|
||||
exit /b %errorlevel%
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user