@echo off setlocal EnableExtensions EnableDelayedExpansion rem Deploy the Release Qt runtime and enumerate Release project artifacts. rem DLLs/LIBs with a _d postfix are Debug-only. Targets without rem DEBUG_POSTFIX are shared by both configurations and are included here. rem .lib files are link-time artifacts: they are checked/listed here, but rem must not be passed to windeployqt. set "SCRIPT_DIR=%~dp0" set "WINDEPLOYQT=%SCRIPT_DIR%..\GlobalCppEnv\qt5\bin\windeployqt.exe" set "BIN=%SCRIPT_DIR%bin" set "LIB=%SCRIPT_DIR%lib" set "CONFIG=Release" set "DEPLOY_MODE=--release" if not exist "%WINDEPLOYQT%" ( echo [windeploy] windeployqt not found: "%WINDEPLOYQT%" goto :failed ) if not exist "%BIN%" ( echo [windeploy] bin directory not found: "%BIN%" goto :failed ) if not exist "%LIB%" ( echo [windeploy] lib directory not found: "%LIB%" goto :failed ) for %%F in ("%BIN%\eui_gui.dll" "%BIN%\eui_core.dll") do ( if not exist "%%~F" ( echo [windeploy] Release binary not found: "%%~F" echo [windeploy] Build Release first, for example: echo [windeploy] cmake --build build --config Release --target eui_app goto :failed ) ) set /a DLL_COUNT=0 for %%F in ("%BIN%\*.dll") do ( call :deploy_project_dll "%%~fF" if errorlevel 1 goto :failed ) set /a LIB_COUNT=0 for %%F in ("%LIB%\*.lib") do ( call :include_project_lib "%%~fF" if errorlevel 1 goto :failed ) if !DLL_COUNT! EQU 0 ( echo [windeploy] No Release project DLL was found. goto :failed ) if !LIB_COUNT! EQU 0 ( echo [windeploy] No Release project LIB was found. goto :failed ) echo. echo [windeploy] Release Qt runtime deployed into "%BIN%". echo [windeploy] Included project DLLs: !DLL_COUNT! echo [windeploy] Included project LIBs: !LIB_COUNT! ^(kept in "%LIB%"^) echo [windeploy] Third-party DLLs and the launcher/eui_app/crashpad trio echo [windeploy] are handled by tools\start_copy_dll.bat and tools\deploy\Deploy-EuiRuntime.ps1. endlocal exit /b 0 :deploy_project_dll set "DLL_PATH=%~1" if not exist "%DLL_PATH%" exit /b 0 set "DLL_NAME=%~n1" set "DLL_SUFFIX=!DLL_NAME:~-2!" if /i "!DLL_SUFFIX!"=="_d" exit /b 0 :project_dll_candidate if not exist "%LIB%\!DLL_NAME!.lib" exit /b 0 echo [windeploy] Release DLL: "%DLL_PATH%" "%WINDEPLOYQT%" %DEPLOY_MODE% "%DLL_PATH%" set "RC=!ERRORLEVEL!" if not "!RC!"=="0" ( echo [windeploy] windeployqt failed for "%DLL_PATH%" with code !RC!. exit /b !RC! ) set /a DLL_COUNT+=1 exit /b 0 :include_project_lib set "LIB_PATH=%~1" if not exist "%LIB_PATH%" exit /b 0 set "LIB_NAME=%~n1" set "LIB_SUFFIX=!LIB_NAME:~-2!" if /i "!LIB_SUFFIX!"=="_d" exit /b 0 echo [windeploy] Release LIB: "%LIB_PATH%" set /a LIB_COUNT+=1 exit /b 0 :failed set "RC=!ERRORLEVEL!" if "!RC!"=="0" set "RC=1" echo [windeploy] Release deployment failed. endlocal & exit /b %RC%