tools/build_windows.bat
author unc0rr
Sun, 17 Dec 2017 21:09:59 +0100
branchqmlfrontend
changeset 12856 95d903b976d0
parent 11379 7bc9042549c1
child 13513 7e188a28f078
permissions -rw-r--r--
Start removing flib functionality
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10017
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
     1
@echo off
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
     2
::edit these variables if you need
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
     3
set PASCAL=C:\FPC\2.6.0\bin\i386-win32\
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
     4
set QTDIR=C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
     5
set PATH=%PATH%;%PASCAL%
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
     6
set BUILD_TYPE="Debug"
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
     7
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
     8
:setup
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
     9
set CURRDIR="%CD%"
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    10
cd ..
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    11
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    12
echo Fetching all DLLs...
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    13
if %BUILD_TYPE%=="Debug" (
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    14
    for %%G in (QtCored4 QtGuid4 QtNetworkd4) do xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    15
)
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    16
:: should you libgcc dynamically you should try adding libgcc_s_dw2-1 and mingwm10
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    17
for %%G in (QtCore4 QtGui4 QtNetwork4) do (
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    18
    xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    19
)
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    20
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    21
if not exist %CD%\misc\winutils\bin\ mkdir %CD%\misc\winutils\bin\
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    22
if not exist %CD%\misc\winutils\bin\SDL.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/release/SDL-1.2.15-win32.zip %CD%\misc\winutils\bin
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    23
if not exist %CD%\misc\winutils\bin\SDL_image.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12-win32.zip %CD%\misc\winutils\bin
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    24
if not exist %CD%\misc\winutils\bin\SDL_net.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.8-win32.zip %CD%\misc\winutils\bin
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    25
if not exist %CD%\misc\winutils\bin\SDL_mixer.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.12-win32.zip %CD%\misc\winutils\bin
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    26
if not exist %CD%\misc\winutils\bin\SDL_ttf.dll cscript %CD%\tools\w32DownloadUnzip.vbs  http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11-win32.zip %CD%\misc\winutils\bin
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    27
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    28
::for video recording
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    29
if not exist %CD%\misc\winutils\bin\avformat-54.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://hedgewars.googlecode.com/files/libav-win32-20121022-dll.zip %CD%\misc\winutils\bin
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    30
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    31
::this is needed because fpc png unit hardcodes libpng-1.2.12
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    32
if not exist %CD%\misc\winutils\bin\libpng13.dll copy /y %CD%\misc\winutils\bin\libpng15-15.dll %CD%\misc\winutils\bin\libpng13.dll
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    33
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    34
xcopy /d/y %CD%\misc\winutils\bin\*.dll %CD%\bin\
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    35
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    36
::setting up the environment...
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    37
call %QTDIR%\qtenv2.bat
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    38
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    39
echo Running cmake...
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    40
set ERRORLEVEL=
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    41
cmake . -G "MinGW Makefiles" -DPNG_LIBRARY="%CD%\misc\winutils\bin\libpng13.dll" -DCMAKE_BUILD_TYPE="%BUILD_TYPE%" -DCMAKE_PREFIX_PATH="%CD%\misc\winutils\\"
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    42
:: prefix should be last
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    43
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    44
if %ERRORLEVEL% NEQ 0 goto exitpoint
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    45
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    46
echo Running make...
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    47
set ERRORLEVEL=
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    48
mingw32-make VERBOSE=1
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    49
if %ERRORLEVEL% NEQ 0 goto exitpoint
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    50
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    51
echo Installing...
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    52
set ERRORLEVEL=
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    53
mingw32-make install > nul
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    54
if %ERRORLEVEL% NEQ 0 goto exitpoint
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    55
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    56
echo Creating commodity shortcut...
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    57
copy /y %CD%\misc\winutils\Hedgewars.lnk C:%HOMEPATH%\Desktop\Hedgewars.lnk
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    58
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    59
echo ALL DONE, Hedgewars has been successfully compiled and installed
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    60
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    61
:exitpoint
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    62
cd %CURRDIR%
de822cd3df3a fixwhitespace and dos2unix
koda
parents: 9224
diff changeset
    63
pause