@echo off rem =========================================================================== rem Remove the build output of every build configuration. rem rem Usage: rem clean_all.bat rem rem Build layout (see config_paths.bat): rem build\\\ rem rem A legacy single-configuration build tree (build\X256_PS or build\X256_MS rem containing CMakeCache.txt directly) is removed as a whole as well. rem build\output (archived package export) is never touched. rem rem Encoding: keep this file ASCII-only (see msvc_env.bat). rem =========================================================================== setlocal EnableExtensions pushd "%~dp0..\.." set "FAILED=" for %%S in (X256_PS X256_MS) do ( if exist "build\%%S\CMakeCache.txt" ( call :remove "build\%%S" ) else ( for %%T in (Debug Release) do ( for %%R in (REC_AUTO REC_OFF REC_ON) do ( call :remove "build\%%S\%%T\%%R" ) ) rem drop the directory root when every configuration is gone rmdir "build\%%S" 2>nul ) ) echo. echo [clean_all] archived package export "build\output" left untouched if defined FAILED ( echo [clean_all] FAILED - some directories could not be removed, close open files and retry popd exit /b 1 ) echo [clean_all] all build configurations removed popd exit /b 0 :remove if not exist "%~1" exit /b 0 echo [clean_all] remove "%~1" rmdir /s /q "%~1" if exist "%~1" ( echo [ERROR] cannot remove "%~1" set "FAILED=1" ) exit /b 0