@echo off setlocal EnableExtensions set "SOURCE_ROOT=%~dp0." set "BUILD_DIR=%SOURCE_ROOT%\build_lib" set "BUILD_DIR_2256=%SOURCE_ROOT%\build_lib2256" for %%D in ("%BUILD_DIR%" "%BUILD_DIR_2256%") do ( if exist "%%~D" ( echo Removing existing build directory %%~D... rmdir /s /q "%%~D" if errorlevel 1 ( echo [ERROR] Failed to remove build directory %%~D. 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 -DEUI_HANDLE_AI_2256=OFF -DEUI_BUILD_MISSIONS=OFF if errorlevel 1 ( echo [ERROR] CMake configuration failed. exit /b 1 ) cmake --build "%BUILD_DIR%" --config Debug --target eui_tools eui_crypto eui_frameworkSdk if errorlevel 1 goto build_failed cmake --build "%BUILD_DIR%" --config Release --target eui_tools eui_crypto eui_frameworkSdk if errorlevel 1 goto build_failed cmake -S "%SOURCE_ROOT%" -B "%BUILD_DIR_2256%" -G "Visual Studio 17 2022" -A x64 -DEUI_USE_PREBUILT_LIBS=OFF -DEUI_HANDLE_AI_2256=ON -DEUI_BUILD_MISSIONS=OFF if errorlevel 1 ( echo [ERROR] CMake 2256 configuration failed. exit /b 1 ) cmake --build "%BUILD_DIR_2256%" --config Debug --target eui_tools if errorlevel 1 goto build_failed cmake --build "%BUILD_DIR_2256%" --config Release --target eui_tools if errorlevel 1 goto build_failed if not exist "%SOURCE_ROOT%\lib\eui_tools2256_d.lib" goto build_failed if not exist "%SOURCE_ROOT%\lib\eui_tools2256.lib" goto build_failed echo eui_tools, eui_crypto, and eui_frameworkSdk Debug and Release builds completed. echo eui_tools2256 Debug and Release builds completed. exit /b 0 :build_failed echo [ERROR] Library build failed. exit /b 1