BuildingOnWindows.wiki
author alfadur
Mon, 07 Sep 2020 01:16:51 +0300
changeset 2186 08ee59cebec7
parent 2185 9677a4852d41
child 2222 57453f1d37cf
permissions -rw-r--r--
fix package syntax
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
     1
#summary Instructions for building Hedgewars on Windows
185
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
     2
#labels Phase-Implementation,Phase-Design,Phase-Support
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
     3
774
86e81308d67d BuildingOnWindows: Edited via web interface
unC0Rr
parents: 757
diff changeset
     4
= Building on Windows =
652
0f7445a72880 Big fat warning about these instructions being outdated
Wuzzy
parents: 594
diff changeset
     5
1967
adf0a1ba96c8 more windows build cleanup
alfadur
parents: 1966
diff changeset
     6
== Prerequisites ==
adf0a1ba96c8 more windows build cleanup
alfadur
parents: 1966
diff changeset
     7
These build instructions require at least Windows 7.
1965
25554a6a7b03 change windows build instructions to use fpc cross-compiler
alfadur
parents: 1964
diff changeset
     8
First of all, figure out whether your system is a 32-bit or a 64-bit system. You can use the guide at [https://support.microsoft.com/en-us/help/15056/windows-32-64-bit-faq]. On a 64-bit system both 32-bit and 64-bit builds can be made, although 64-bit is preferred. Making a 64-bit build on a 32-bit system might be possible, but hasn't been tested.
1891
8c23bd1647de BuildingOnWindows: Link to other wikipage
Wuzzy
parents: 798
diff changeset
     9
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    10
== Required Tools ==
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    11
Choose either 32-bit or 64-bit depending on your system and which build you want to make.
185
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
    12
1967
adf0a1ba96c8 more windows build cleanup
alfadur
parents: 1966
diff changeset
    13
  * CMake: click either *Windows win32-x86 Installer* or *Windows win64-x64 Installer*
1968
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    14
    * Link: https://cmake.org/download/
1967
adf0a1ba96c8 more windows build cleanup
alfadur
parents: 1966
diff changeset
    15
  * Visual Studio: click *Download Visual Studio → Community 2019* (earlier version starting from Community 2015 Update 3 might also work)
1968
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    16
    * Link: https://visualstudio.microsoft.com/
1967
adf0a1ba96c8 more windows build cleanup
alfadur
parents: 1966
diff changeset
    17
  * Vcpkg
1969
93991afec8b1 add missing list item
alfadur
parents: 1968
diff changeset
    18
    * Link: https://github.com/Microsoft/vcpkg
1967
adf0a1ba96c8 more windows build cleanup
alfadur
parents: 1966
diff changeset
    19
  * !FreePascal: click *Windows 32-bit*, then download *fpc-<version>-win32.exe* (for 64-bit builds also download *fpc-<version>.i386-win32.cross.x86_64-win64.exe*)
1968
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    20
    * Link: https://www.freepascal.org/download.html
1967
adf0a1ba96c8 more windows build cleanup
alfadur
parents: 1966
diff changeset
    21
  * Mercurial: pick one (!TortoiseHg has a GUI and is more user-friendly)
1968
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    22
    * !TortoiseHg: Chose one based on your OS version
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    23
      * Link: https://tortoisehg.bitbucket.io/
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    24
    * Command-line mercurial
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    25
      * Link: http://mercurial.selenic.com/downloads/
185
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
    26
757
0ac49c33cf3e BuildingOnWindows: Add title, fix header levels
Wuzzy
parents: 652
diff changeset
    27
== Setup ==
1968
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    28
  * Install CMake, but please *ensure* you select "Add CMake to the system PATH for all users", so you can run CMake directly from the command line.
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    29
  * Install !FreePascal and if necessary the 64-bit cross-compiler plugin (the one with `cross.x86_64-win64` in the file name).
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    30
  * Install Visual Studio, ensuring the *Workloads → Desktop development with C++* and *Language packs → English* options are selected.
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    31
  * Install Vcpkg by following the instructions under *Quick Start* section on the project page. If you don't have Git, use the *Clone or download → Download ZIP* option and extract the ZIP file. Create `VCPKG_ROOT` environment variable pointing to the directory you've cloned/extracted it to.
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    32
  * Install !TortoiseHg / Mercurial
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    33
  * Restart the computer
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    34
  * Download the Hedgewars source code:
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    35
    * Using !TortoiseHg:
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    36
      * Right-click in any folder on your computer
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    37
      * Select Tortoise HG → Clone.
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    38
      * In the _Source_ textbox, enter: https://hg.hedgewars.org/hedgewars/
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    39
      * Press "clone"
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    40
    * Using command-line Mercurial
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    41
      * Shift + Right-click in the folder where you want to download the source and select "Open Command Prompt Window Here" or "Open PowerShell window here".   
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    42
      * Type and execute (The initial clone of the repository will take a while): `hg clone https://hg.hedgewars.org/hedgewars/ trunk`
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    43
  * Navigate to the Vcpkg directory in the command line and build the necessary libraries (this will also take a while, especially for Qt). The command is:
2186
08ee59cebec7 fix package syntax
alfadur
parents: 2185
diff changeset
    44
    * For 32-bit builds: `.\vcpkg.exe install sdl2 sdl2-image sdl2-ttf sdl2-mixer[dynamic-load,libvorbis] sdl2-net physfs openssl qt5-base qt5-tools ffmpeg`
08ee59cebec7 fix package syntax
alfadur
parents: 2185
diff changeset
    45
    * For 64-bit builds: `.\vcpkg.exe install sdl2:x64-windows sdl2-image:x64-windows sdl2-ttf:x64-windows sdl2-mixer[dynamic-load,libvorbis]:x64-windows sdl2-net:x64-windows physfs:x64-windows openssl:x64-windows qt5-base:x64-windows qt5-tools:x64-windows ffmpeg:x64-windows`
1968
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    46
  * Build Hedgewars
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    47
    * From the Start menu run either "x86 Native Tools Command Prompt for VS 2019" or "x64 Native Tools Command Prompt for VS 2019" (if you want Hedgewars to install to the default location in `C:\Program Files`, run it as administrator).  
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    48
    * Navigate to `<hedgewars_root>\tools` where `<hedgewars_root>` is the directory where you cloned the repository source to.
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    49
    * Run `build_vcpkg.bat` script
ae2af57be656 remove ordered lists
alfadur
parents: 1967
diff changeset
    50
  * After building, you can run Hedgewars from the installed location (default is `C:\Program Files\hedgewars\hedgewars.exe`)
1967
adf0a1ba96c8 more windows build cleanup
alfadur
parents: 1966
diff changeset
    51
adf0a1ba96c8 more windows build cleanup
alfadur
parents: 1966
diff changeset
    52
 == Additional options ==
1969
93991afec8b1 add missing list item
alfadur
parents: 1968
diff changeset
    53
 Check the top section of `build_vcpkg.bat` to change some of the build options.