@echo off setlocal EnableExtensions set "SOURCE_ROOT=%~dp0." set "BUILD_DIR=%SOURCE_ROOT%\build_all" set "BIN_DIR=%SOURCE_ROOT%\bin" if exist "%BUILD_DIR%" ( echo Removing existing build directory... rmdir /s /q "%BUILD_DIR%" if errorlevel 1 ( echo [ERROR] Failed to remove the existing build directory. exit /b 1 ) ) if exist "%BIN_DIR%" ( echo Removing generated runtime artifacts... for %%T in (eui_app launcher eui_gui eui_gui_d eui_core eui_core_d eui_singleton eui_singleton_d crashpad_handler) do ( for %%E in (dll exe pdb ilk manifest) do ( if exist "%BIN_DIR%\%%T.%%E" ( del /f /q "%BIN_DIR%\%%T.%%E" if errorlevel 1 ( echo [ERROR] Failed to remove "%BIN_DIR%\%%T.%%E". exit /b 1 ) ) ) ) ) where cmake >nul 2>&1 if errorlevel 1 ( echo [ERROR] CMake was not found on PATH. exit /b 1 ) cmake -S "%SOURCE_ROOT%" -B "%BUILD_DIR%" -G "Visual Studio 17 2022" -A x64 -DEUI_USE_PREBUILT_LIBS=OFF -DBUILD_UNIT_TESTS=OFF -DEUI_BUILD_SUBMODULES=OFF -DEUI_BUILD_RPCMODULES=OFF -DEUI_BUILD_MISSIONS=OFF if errorlevel 1 ( echo [ERROR] CMake configuration failed. exit /b 1 ) echo Building all targets in Debug, including src DLL targets... cmake --build "%BUILD_DIR%" --config Debug if errorlevel 1 goto build_failed echo Building all targets in Release, including src DLL targets... cmake --build "%BUILD_DIR%" --config Release if errorlevel 1 goto build_failed echo All Debug and Release targets completed. exit /b 0 :build_failed echo [ERROR] Full build failed. exit /b 1