BuildingOnWindows.wiki
author Wuzzy
Wed, 21 Aug 2019 23:25:59 +0100
changeset 1956 625477ff2786
parent 1955 637685e52477
child 1957 166ed9944600
permissions -rw-r--r--
BuildingOnWindows: Formatting, grammar fixes
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
757
0ac49c33cf3e BuildingOnWindows: Add title, fix header levels
Wuzzy
parents: 652
diff changeset
     6
== Things to download ==
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
     7
First of all, figure out whether your system is a 32-bit or a 64-bit system. You can use the guide at [http://windows.microsoft.com/en-US/windows7/find-out-32-or-64-bit]. You will only be able to make a 64-bit build on a 64-bit system. 32-bit builds can be made on both 32-bit and 64-bit systems.
1891
8c23bd1647de BuildingOnWindows: Link to other wikipage
Wuzzy
parents: 798
diff changeset
     8
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
     9
== Required Tools ==
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    10
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
    11
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    12
 # CMake: click either *Windows win64-x64 Installer* or *Windows win32-x86 Installer*
1893
dae83669bc68 BuildingOnWindows: Update links
Wuzzy
parents: 1891
diff changeset
    13
  * Link: https://cmake.org/download/
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    14
 # Visual Studio: click *Download Visual Studio → Community 2019* (earlier version starting from Community 2015 Update 3 might also work)
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    15
  * Link: https://visualstudio.microsoft.com/
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    16
 # Vcpkg
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    17
  * Link: https://github.com/Microsoft/vcpkg
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    18
 # !FreePascal
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    19
  * 32-bit compiler: click *Windows 32-bit*
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    20
   * Link: https://www.freepascal.org/download.html
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    21
  * 64-bit compiler (necessary for 64-bit builds, bundled with Lazarus IDE): click *Windows (64-bit)*
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    22
   * Link: https://www.lazarus-ide.org/index.php?page=downloads
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    23
 # Mercurial: pick one (!TortoiseHg has a GUI and is more user-friendly)
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    24
  * !TortoiseHg: Chose one based on your OS version
1893
dae83669bc68 BuildingOnWindows: Update links
Wuzzy
parents: 1891
diff changeset
    25
   * Link: https://tortoisehg.bitbucket.io/
1895
93f8269fca27 BuildingOnWindows: Fix indents?
Wuzzy
parents: 1894
diff changeset
    26
  * Command-line mercurial
266
76e82a7897f1 updated qt, fpc and hg links
vittorio.giovara@gmail.com
parents: 212
diff changeset
    27
   * Link: http://mercurial.selenic.com/downloads/
185
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
    28
757
0ac49c33cf3e BuildingOnWindows: Add title, fix header levels
Wuzzy
parents: 652
diff changeset
    29
== Setup ==
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    30
 # 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.
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    31
 # Install !FreePascal / Lazarus IDE. Add the directory containing `fpc.exe` to the `PATH` environment variable (either user or system).
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    32
 # Install !VisualStudio, ensuring the *Workloads → Desktop development with C++* option is selected.
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    33
 # 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 clones/extracted it to.
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    34
 # Install !TortoiseHg / Mercurial
185
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
    35
 # Restart the computer
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    36
 # Download the Hedgewars source code:
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    37
  # Using !TortoiseHg:
185
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
    38
   * Right-click in any folder on your computer
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    39
   * Select Tortoise HG → Clone.
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    40
   * In the _Source_ textbox, enter: https://hg.hedgewars.org/hedgewars/
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    41
   * Press "clone"
318
b5c9ee17f621 Updating the QtSDK link *again*. This time it does actually link to the QtSDK and it really does work.
Caironater@gmail.com
parents: 316
diff changeset
    42
  # Using command-line Mercurial
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    43
   * If you have Windows 7 or later, skip the next 3 steps, and instead, use Shift + Right-click in the folder where you want to download the source.
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    44
   * Start _Run..._ ( Press Windows key + R, or click on the Start menu, then on "Run ..." )
185
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
    45
   * Enter:
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
    46
{{{
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
    47
cmd.exe
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    48
}}}
185
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
    49
   * Navigate to where you want to download the source
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    50
   * Type and execute (The initial clone of the repository will take a while):
185
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
    51
{{{
798
30c5f1ebd552 global replace of http with https for hedgewars.org wiki links
nemo
parents: 774
diff changeset
    52
hg clone https://hg.hedgewars.org/hedgewars/ trunk
185
859277aa45f2 Add windows building wiki page.
ovibalea@gmail.com
parents:
diff changeset
    53
}}}
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    54
 # Run Vckpg in the command line to build the necessary libraries (this will also take a while, especially for Qt). The command is:
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    55
  * For 32-bit builds:
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    56
{{{
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    57
./vcpkg.exe install sdl2 sdl2-image sdl2-ttf sdl2-mixer sdl2-mixer[libvorbis] physfs openssl qt5-base qt5-tools ffmpeg
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    58
}}}
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    59
  * For 64-bit builds:
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    60
{{{
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    61
./vcpkg.exe install sdl2:x64-windows sdl2-image:x64-windows sdl2-ttf:x64-windows sdl2-mixer:x64-windows sdl2-mixer[libvorbis]:x64-windows physfs:x64-windows openssl:x64-windows qt5-base:x64-windows qt5-tool:x64-windows ffmpeg:x64-windows
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    62
}}}
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    63
 # Build Hedgewars
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    64
  * Run the Developer Command Prompt for VS 2019 (or other installed version) from the Start menu (if you want Hedgewars to install to the default location in *C:/Program Files (x86)*, run it as administrator).
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    65
  * For 64-bit builds, in the dev command prompt run the following command (not necessary for 32-bit builds)
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    66
{{{
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    67
VC\Auxiliary\Build\vcvarsall.bat amd64
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    68
}}}
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    69
  * Navigate to `<hedgewars_root>/tools` where `<hedgewars_root>` is the directory where you cloned the repository source to.
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    70
  * Run `build_vcpkg.bat` script
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    71
 # After building, you can run Hedgewars from the installed location (default is `C:/Program Files (x86)/hedgewars/hedgewars.exe`)
212
d47acc7f7185 additional instruction for vs2010 by adam.madram (issue 379)
vittorio.giovara@gmail.com
parents: 195
diff changeset
    72
1955
637685e52477 Update Windows building guide
alfadur
parents: 1895
diff changeset
    73
== Caveats ==
1956
625477ff2786 BuildingOnWindows: Formatting, grammar fixes
Wuzzy
parents: 1955
diff changeset
    74
 # The linker from 64-bit FPC included in the Lazarus IDE might occasionally fail, producing `hwengine.exe` filled with zeroes. If this happens, just delete it and re-run `tools/build_vcpkg.bat` again (or run `nmake hedgewars` in the root directory to only rebuild the engine)