Vendored
+34
-12
@@ -1,22 +1,44 @@
|
||||
@echo off
|
||||
rem ===========================================================================
|
||||
rem CMake clean script (MSVC 2022 / v143, C++17, x64)
|
||||
rem CMake clean script - remove the build output of one configuration.
|
||||
rem
|
||||
rem Usage: clean.bat <build-dir>
|
||||
rem e.g. clean.bat build\X256_PS
|
||||
rem Usage:
|
||||
rem clean.bat ^<PHASE_SCANNING^|MECHANICAL_SCANNING^> ^<Debug^|Release^> [AUTO^|ON^|OFF]
|
||||
rem
|
||||
rem Examples:
|
||||
rem clean.bat PHASE_SCANNING Release OFF
|
||||
rem clean.bat MECHANICAL_SCANNING Debug ON
|
||||
rem
|
||||
rem The directory removed is the same one configure.bat/build.bat use:
|
||||
rem build\<X256_PS^|X256_MS^>\<Debug^|Release^>\<REC_AUTO^|REC_OFF^|REC_ON^>
|
||||
rem Use clean_all.bat to clean every configuration at once.
|
||||
rem
|
||||
rem Encoding: keep this file ASCII-only (see msvc_env.bat).
|
||||
rem ===========================================================================
|
||||
setlocal
|
||||
set "BUILD_DIR=%~1"
|
||||
if "%BUILD_DIR%"=="" (
|
||||
echo Usage: clean.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
|
||||
|
||||
pushd "%~dp0..\.."
|
||||
if not exist "%BUILD_DIR%" (
|
||||
echo [clean] "%BUILD_DIR%" does not exist - nothing to do
|
||||
popd
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
rem Load the MSVC 2022 environment (vcvarsall.bat + cl.exe existence check).
|
||||
call "%~dp0msvc_env.bat"
|
||||
if errorlevel 1 exit /b %errorlevel%
|
||||
echo [clean] remove "%BUILD_DIR%"
|
||||
rmdir /s /q "%BUILD_DIR%"
|
||||
if exist "%BUILD_DIR%" (
|
||||
echo [ERROR] cannot remove "%BUILD_DIR%", close open files and retry.
|
||||
popd
|
||||
exit /b 1
|
||||
)
|
||||
popd
|
||||
exit /b 0
|
||||
|
||||
cmake --build "%BUILD_DIR%" --target clean
|
||||
exit /b %errorlevel%
|
||||
:usage
|
||||
echo Usage: clean.bat ^<PHASE_SCANNING^|MECHANICAL_SCANNING^> ^<Debug^|Release^> [AUTO^|ON^|OFF^]
|
||||
exit /b 1
|
||||
|
||||
Reference in New Issue
Block a user