@echo off setlocal EnableExtensions EnableDelayedExpansion rem Deploy the Debug Qt runtime and enumerate Debug project artifacts. rem DLLs with a _d postfix are Debug-only. Targets without DEBUG_POSTFIX rem are shared by both configurations and are included in both scripts. 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=Debug" set "DEPLOY_MODE=--debug" 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_d.dll" "%BIN%\eui_core_d.dll") do ( if not exist "%%~F" ( echo [windeploy] Debug binary not found: "%%~F" echo [windeploy] Build Debug first, for example: echo [windeploy] cmake --build build --config Debug --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 Debug project DLL was found. goto :failed ) if !LIB_COUNT! EQU 0 ( echo [windeploy] No Debug project LIB was found. goto :failed ) echo. echo [windeploy] Debug 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!" rem Release-name files with a Debug counterpart are not Debug artifacts. if /i "!DLL_SUFFIX!"=="_d" goto :debug_dll_candidate if exist "%BIN%\!DLL_NAME!_d.dll" exit /b 0 goto :project_dll_candidate :debug_dll_candidate if not exist "%LIB%\!DLL_NAME!.lib" exit /b 0 :project_dll_candidate if not exist "%LIB%\!DLL_NAME!.lib" exit /b 0 echo [windeploy] Debug 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" goto :debug_lib_candidate if exist "%LIB%\!LIB_NAME!_d.lib" exit /b 0 :debug_lib_candidate echo [windeploy] Debug LIB: "%LIB_PATH%" set /a LIB_COUNT+=1 exit /b 0 :failed set "RC=!ERRORLEVEL!" if "!RC!"=="0" set "RC=1" echo [windeploy] Debug deployment failed. endlocal & exit /b %RC%