2 #labels Phase-Implementation,Phase-Design,Phase-Support |
2 #labels Phase-Implementation,Phase-Design,Phase-Support |
3 |
3 |
4 = Building on Windows = |
4 = Building on Windows = |
5 |
5 |
6 == Things to download == |
6 == Things to download == |
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. |
7 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. |
8 |
8 |
9 == Required Tools == |
9 == Required Tools == |
10 Choose either 32-bit or 64-bit depending on your system and which build you want to make. |
10 Choose either 32-bit or 64-bit depending on your system and which build you want to make. |
11 |
11 |
12 # CMake: click either *Windows win64-x64 Installer* or *Windows win32-x86 Installer* |
12 # CMake: click either *Windows win32-x86 Installer* or *Windows win64-x64 Installer* |
13 * Link: https://cmake.org/download/ |
13 * Link: https://cmake.org/download/ |
14 # Visual Studio: click *Download Visual Studio → Community 2019* (earlier version starting from Community 2015 Update 3 might also work) |
14 # Visual Studio: click *Download Visual Studio → Community 2019* (earlier version starting from Community 2015 Update 3 might also work) |
15 * Link: https://visualstudio.microsoft.com/ |
15 * Link: https://visualstudio.microsoft.com/ |
16 # Vcpkg |
16 # Vcpkg |
17 * Link: https://github.com/Microsoft/vcpkg |
17 * Link: https://github.com/Microsoft/vcpkg |
18 # !FreePascal |
18 # !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) |
19 * 32-bit compiler: click *Windows 32-bit* |
19 * Link: https://www.freepascal.org/download.html |
20 * Link: https://www.freepascal.org/download.html |
|
21 * 64-bit compiler (necessary for 64-bit builds, bundled with Lazarus IDE): click *Windows (64-bit)* |
|
22 * Link: https://www.lazarus-ide.org/index.php?page=downloads |
|
23 # Mercurial: pick one (!TortoiseHg has a GUI and is more user-friendly) |
20 # Mercurial: pick one (!TortoiseHg has a GUI and is more user-friendly) |
24 * !TortoiseHg: Chose one based on your OS version |
21 * !TortoiseHg: Chose one based on your OS version |
25 * Link: https://tortoisehg.bitbucket.io/ |
22 * Link: https://tortoisehg.bitbucket.io/ |
26 * Command-line mercurial |
23 * Command-line mercurial |
27 * Link: http://mercurial.selenic.com/downloads/ |
24 * Link: http://mercurial.selenic.com/downloads/ |
28 |
25 |
29 == Setup == |
26 == Setup == |
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. |
27 # 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. |
31 # Install !FreePascal / Lazarus IDE. Add the directory containing `fpc.exe` to the `PATH` environment variable (either user or system). |
28 # Install !FreePascal and if necessary the 64-bit cross-compiler plugin (the one with `cross.x86_64-win64` in the file name). |
32 # Install !VisualStudio, ensuring the *Workloads → Desktop development with C++* and *Language packs → English* options are selected. |
29 # Install Visual Studio, ensuring the *Workloads → Desktop development with C++* and *Language packs → English* options are selected. |
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 cloned/extracted it to. |
30 # 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. |
34 # Install !TortoiseHg / Mercurial |
31 # Install !TortoiseHg / Mercurial |
35 # Restart the computer |
32 # Restart the computer |
36 # Download the Hedgewars source code: |
33 # Download the Hedgewars source code: |
37 # Using !TortoiseHg: |
34 # Using !TortoiseHg: |
52 * 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). |
49 * 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). |
53 * For 64-bit builds, in the dev command prompt run the following command (not necessary for 32-bit builds): `VC\Auxiliary\Build\vcvarsall.bat amd64` |
50 * For 64-bit builds, in the dev command prompt run the following command (not necessary for 32-bit builds): `VC\Auxiliary\Build\vcvarsall.bat amd64` |
54 * Navigate to `<hedgewars_root>\tools` where `<hedgewars_root>` is the directory where you cloned the repository source to. |
51 * Navigate to `<hedgewars_root>\tools` where `<hedgewars_root>` is the directory where you cloned the repository source to. |
55 * Run `build_vcpkg.bat` script |
52 * Run `build_vcpkg.bat` script |
56 # After building, you can run Hedgewars from the installed location (default is `C:\Program Files (x86)\hedgewars\hedgewars.exe`) |
53 # After building, you can run Hedgewars from the installed location (default is `C:\Program Files (x86)\hedgewars\hedgewars.exe`) |
57 |
|
58 == Caveats == |
|
59 # 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) |
|