58 lines
1.6 KiB
Batchfile
58 lines
1.6 KiB
Batchfile
@echo off
|
|
echo ============================================
|
|
echo PacManager - Build Windows
|
|
echo ============================================
|
|
echo.
|
|
|
|
set MSYS2=C:\msys64
|
|
set MINGW=%MSYS2%\mingw64\bin
|
|
set MSYS2_SHELL=%MSYS2%\msys2_shell.cmd
|
|
|
|
if not exist "%MINGW%\gcc.exe" (
|
|
echo [ERREUR] gcc non trouve dans %MINGW%
|
|
echo Installez les packages MSYS2 :
|
|
echo pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-qt6-base make
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo [1/4] Configuration CMake...
|
|
mkdir build_windows 2>nul
|
|
cd build_windows
|
|
|
|
"%MINGW%\cmake.exe" .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
|
|
if errorlevel 1 (
|
|
echo [ERREUR] CMake a echoue
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo [2/4] Compilation...
|
|
"%MINGW%\mingw32-make.exe" -j%NUMBER_OF_PROCESSORS%
|
|
if errorlevel 1 (
|
|
echo [ERREUR] Compilation echouee
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo [3/4] Copie des DLLs...
|
|
"%MSYS2_SHELL%" -defterm -no-start -mingw64 -c "cd /e/dev/gestionnaire/build_windows && ldd PacManager.exe 2>/dev/null | grep 'mingw64' | awk '{print $3}' | while read dll; do cp \"$dll\" . 2>/dev/null; done"
|
|
|
|
echo.
|
|
echo [4/4] Copie des DLLs des plugins...
|
|
"%MSYS2_SHELL%" -defterm -no-start -mingw64 -c "cd /e/dev/gestionnaire/build_windows && for plugin in plugins/*/*.dll; do ldd \"$plugin\" 2>/dev/null | grep 'mingw64' | awk '{print $3}' | while read dll; do cp \"$dll\" . 2>/dev/null; done; done"
|
|
|
|
echo.
|
|
echo ============================================
|
|
echo BUILD REUSSI !
|
|
echo Executable : build_windows\PacManager.exe
|
|
echo ============================================
|
|
echo.
|
|
echo Pour lancer :
|
|
echo cd build_windows
|
|
echo PacManager.exe
|
|
echo.
|
|
pause
|