tools/build_windows.bat
author unc0rr
Fri, 13 Sep 2013 21:55:53 +0400
changeset 9460 7d7e4ca70f6b
parent 9224 bce8cf41d666
child 10017 de822cd3df3a
permissions -rw-r--r--
Skip some LandPixels manipulations in stats-only mode
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     1
@echo off
7799
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
     2
::edit these variables if you need
8068
b35427506169 win build changes, fpc 2.6, CMAKE_PREFIX_PATH, glut header
koda
parents: 7815
diff changeset
     3
set PASCAL=C:\FPC\2.6.0\bin\i386-win32\
7799
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
     4
set QTDIR=C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
     5
set PATH=%PATH%;%PASCAL%
7815
1a3a62b0ac11 I hate Windows and it hates me...
koda
parents: 7813
diff changeset
     6
set BUILD_TYPE="Debug"
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     7
7799
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
     8
:setup
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
     9
set CURRDIR="%CD%"
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    10
cd ..
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    11
7810
da60e6b6baa3 download SDL dlls if not present
koda
parents: 7799
diff changeset
    12
echo Fetching all DLLs...
7815
1a3a62b0ac11 I hate Windows and it hates me...
koda
parents: 7813
diff changeset
    13
if %BUILD_TYPE%=="Debug" (
1a3a62b0ac11 I hate Windows and it hates me...
koda
parents: 7813
diff changeset
    14
    for %%G in (QtCored4 QtGuid4 QtNetworkd4) do xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
1a3a62b0ac11 I hate Windows and it hates me...
koda
parents: 7813
diff changeset
    15
)
9068
3401390f03cf on Windows link libgcc statically to reduce the number of dlls
koda
parents: 8734
diff changeset
    16
:: should you libgcc dynamically you should try adding libgcc_s_dw2-1 and mingwm10
3401390f03cf on Windows link libgcc statically to reduce the number of dlls
koda
parents: 8734
diff changeset
    17
for %%G in (QtCore4 QtGui4 QtNetwork4) do (
7815
1a3a62b0ac11 I hate Windows and it hates me...
koda
parents: 7813
diff changeset
    18
    xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
7810
da60e6b6baa3 download SDL dlls if not present
koda
parents: 7799
diff changeset
    19
)
da60e6b6baa3 download SDL dlls if not present
koda
parents: 7799
diff changeset
    20
da60e6b6baa3 download SDL dlls if not present
koda
parents: 7799
diff changeset
    21
if not exist %CD%\misc\winutils\bin\ mkdir %CD%\misc\winutils\bin\
da60e6b6baa3 download SDL dlls if not present
koda
parents: 7799
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
da60e6b6baa3 download SDL dlls if not present
koda
parents: 7799
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
da60e6b6baa3 download SDL dlls if not present
koda
parents: 7799
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
da60e6b6baa3 download SDL dlls if not present
koda
parents: 7799
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
da60e6b6baa3 download SDL dlls if not present
koda
parents: 7799
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
da60e6b6baa3 download SDL dlls if not present
koda
parents: 7799
diff changeset
    27
7813
7ac83d79b897 support video recording on windows with automation and headers
koda
parents: 7812
diff changeset
    28
::for video recording
7ac83d79b897 support video recording on windows with automation and headers
koda
parents: 7812
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
7815
1a3a62b0ac11 I hate Windows and it hates me...
koda
parents: 7813
diff changeset
    30
if not exist %CD%\misc\winutils\bin\glut32.dll cscript %CD%\tools\w32DownloadUnzip.vbs https://user.xmission.com/~nate/glut/glut-3.7.6-bin.zip %CD%\misc\winutils\bin
1a3a62b0ac11 I hate Windows and it hates me...
koda
parents: 7813
diff changeset
    31
copy /y %CD%\misc\winutils\bin\glut-3.7.6-bin\glut32.dll %CD%\misc\winutils\bin\glut32.dll
7813
7ac83d79b897 support video recording on windows with automation and headers
koda
parents: 7812
diff changeset
    32
7812
00696c1450da enable png support under win32
koda
parents: 7810
diff changeset
    33
::this is needed because fpc png unit hardcodes libpng-1.2.12
00696c1450da enable png support under win32
koda
parents: 7810
diff changeset
    34
if not exist %CD%\misc\winutils\bin\libpng13.dll copy /y %CD%\misc\winutils\bin\libpng15-15.dll %CD%\misc\winutils\bin\libpng13.dll
00696c1450da enable png support under win32
koda
parents: 7810
diff changeset
    35
7815
1a3a62b0ac11 I hate Windows and it hates me...
koda
parents: 7813
diff changeset
    36
xcopy /d/y %CD%\misc\winutils\bin\*.dll %CD%\bin\
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    37
7799
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    38
::setting up the environment...
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    39
call %QTDIR%\qtenv2.bat
6569
64f9fbd48b9e updated win build script
bovi
parents: 6562
diff changeset
    40
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    41
echo Running cmake...
7799
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    42
set ERRORLEVEL=
9099
a2af0ef2b664 if you use misuse labels as comments please at least keep in mind that labels cannot be used inline, within code blocks or with indentation!
sheepluva
parents: 9090
diff changeset
    43
cmake . -G "MinGW Makefiles" -DPNG_LIBRARY="%CD%\misc\winutils\bin\libpng13.dll" -DCMAKE_BUILD_TYPE="%BUILD_TYPE%" -DCMAKE_PREFIX_PATH="%CD%\misc\winutils\\"
a2af0ef2b664 if you use misuse labels as comments please at least keep in mind that labels cannot be used inline, within code blocks or with indentation!
sheepluva
parents: 9090
diff changeset
    44
:: prefix should be last
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    45
7799
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    46
if %ERRORLEVEL% NEQ 0 goto exitpoint
6569
64f9fbd48b9e updated win build script
bovi
parents: 6562
diff changeset
    47
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    48
echo Running make...
7799
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    49
set ERRORLEVEL=
8068
b35427506169 win build changes, fpc 2.6, CMAKE_PREFIX_PATH, glut header
koda
parents: 7815
diff changeset
    50
mingw32-make VERBOSE=1
7799
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    51
if %ERRORLEVEL% NEQ 0 goto exitpoint
6569
64f9fbd48b9e updated win build script
bovi
parents: 6562
diff changeset
    52
7799
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    53
echo Installing...
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    54
set ERRORLEVEL=
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    55
mingw32-make install > nul
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    56
if %ERRORLEVEL% NEQ 0 goto exitpoint
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    57
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    58
echo Creating commodity shortcut...
7812
00696c1450da enable png support under win32
koda
parents: 7810
diff changeset
    59
copy /y %CD%\misc\winutils\Hedgewars.lnk C:%HOMEPATH%\Desktop\Hedgewars.lnk
7799
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    60
6569
64f9fbd48b9e updated win build script
bovi
parents: 6562
diff changeset
    61
echo ALL DONE, Hedgewars has been successfully compiled and installed
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    62
7799
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    63
:exitpoint
a88a02c19a5b tweaks to win build script, hedgewars.pro now supports win32 target
koda
parents: 6569
diff changeset
    64
cd %CURRDIR%
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    65
pause