Add DLL sweep to build-production batch script
This commit is contained in:
@ -65,8 +65,15 @@ if exist "FreeSans.ttf" copy "FreeSans.ttf" "dist\TetrisGame\"
|
||||
|
||||
REM Copy SDL DLLs (if available) - SDL_image no longer needed
|
||||
echo Copying dependencies...
|
||||
if exist "vcpkg_installed\x64-windows\bin\SDL3.dll" copy "vcpkg_installed\x64-windows\bin\SDL3.dll" "dist\TetrisGame\"
|
||||
if exist "vcpkg_installed\x64-windows\bin\SDL3_ttf.dll" copy "vcpkg_installed\x64-windows\bin\SDL3_ttf.dll" "dist\TetrisGame\"
|
||||
set "PackageDir=dist\TetrisGame"
|
||||
set "copiedDependencies=0"
|
||||
|
||||
call :CopyDependencyDir "build-release\vcpkg_installed\x64-windows\bin"
|
||||
call :CopyDependencyDir "vcpkg_installed\x64-windows\bin"
|
||||
|
||||
if "%copiedDependencies%"=="0" (
|
||||
echo Warning: No dependency DLLs were copied. Ensure vcpkg release binaries exist.
|
||||
)
|
||||
|
||||
REM Create launcher batch file
|
||||
echo @echo off > "dist\TetrisGame\Launch-Tetris.bat"
|
||||
@ -84,3 +91,21 @@ echo The game is ready for distribution!
|
||||
echo Users can run tetris.exe or Launch-Tetris.bat
|
||||
echo.
|
||||
pause
|
||||
goto :eof
|
||||
|
||||
:CopyDependencyDir
|
||||
set "dllDir=%~1"
|
||||
if not exist "%dllDir%" goto :eof
|
||||
echo Scanning %dllDir% for DLLs...
|
||||
for %%F in ("%dllDir%\*.dll") do (
|
||||
if exist "%%~fF" (
|
||||
if exist "%PackageDir%\%%~nxF" (
|
||||
copy /Y "%%~fF" "%PackageDir%\%%~nxF" >nul
|
||||
) else (
|
||||
copy "%%~fF" "%PackageDir%\" >nul
|
||||
)
|
||||
echo Copied %%~nxF
|
||||
set "copiedDependencies=1"
|
||||
)
|
||||
)
|
||||
goto :eof
|
||||
|
||||
Reference in New Issue
Block a user