Skip to content

Commit cfeb492

Browse files
authored
Merge pull request #1764 from heinezen/doc/win-vulkan
Add `vulkan` package to Windows vcpkg install instructions
2 parents 2e40e68 + 932358c commit cfeb492

File tree

1 file changed

+68
-56
lines changed

1 file changed

+68
-56
lines changed

doc/build_instructions/windows_msvc.md

Lines changed: 68 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -17,100 +17,112 @@ __NOTE:__ You need to manually make sure and doublecheck if the system you are b
1717
-->
1818

1919
## Setting up the build environment
20-
You will need to download and install the following manually.
21-
Those who already have the latest stable versions of these programs can skip this:
22-
- [Visual Studio Buildtools](https://aka.ms/vs/17/release/vs_BuildTools.exe)
23-
- With the "Visual C++ Buildtools" workload.
20+
You will need to download and install the following manually.
21+
Those who already have the latest stable versions of these programs can skip this:
2422

25-
_NOTE:_ If you are searching for an IDE for development you can get an overview [here](https://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#C/C++).
26-
We've also written some [instructions for developing with different IDEs](/doc/ide/README.md).
23+
- [Visual Studio Buildtools](https://aka.ms/vs/17/release/vs_BuildTools.exe)
24+
- With the "Visual C++ Buildtools" workload.
25+
_NOTE:_ If you are searching for an IDE for development you can get an overview [here](https://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#C/C++). We've also written some [instructions for developing with different IDEs](/doc/ide/README.md).
2726

28-
- [Python 3](https://www.python.org/downloads/windows/)
29-
- With the "pip" option enabled. We use `pip` to install other dependencies.
30-
- With the "Precompile standard library" option enabled.
31-
- With the "Download debug binaries (...)" option enabled.
32-
- If in doubt, run the installer again and choose "Modify".
33-
- You are going to need the 64-bit version of python if you are planning to build the 64-bit version of openage, and vice versa.
27+
- [Python 3](https://www.python.org/downloads/windows/)
28+
- With the *pip* option enabled. We use `pip` to install other dependencies.
29+
- With the *Precompile standard library* option enabled.
30+
- With the *Download debug binaries (...)* option enabled.
31+
- If in doubt, run the installer again and choose *Modify*.
32+
- You are going to need the 64-bit version of python if you are planning to build the 64-bit version of openage, and vice versa.
3433

3534
- [CMake](https://cmake.org/download/)
3635

3736
### Python Modules
38-
Open a command prompt at `<Python 3 installation directory>/Scripts`
39-
40-
pip install cython numpy lz4 toml pillow pygments pyreadline3 mako
37+
Open a command prompt at `<Python 3 installation directory>/Scripts`
4138

39+
```ps
40+
pip install cython numpy lz4 toml pillow pygments pyreadline3 mako
41+
```
4242
_Note:_ Make sure the Python 3 instance you're installing these scripts for is the one you call `python` in CMD
43+
4344
_Note:_ Also ensure that `python` and `python3` both point to the correct and the same version of Python 3
4445

4546
### vcpkg packages
46-
Set up [vcpkg](https://github.com/Microsoft/vcpkg#quick-start). Open a command prompt at `<vcpkg directory>`
47+
Set up [vcpkg](https://github.com/Microsoft/vcpkg#quick-start). Open a command prompt at `<vcpkg directory>`
4748

48-
vcpkg install dirent eigen3 fontconfig freetype harfbuzz libepoxy libogg libpng opus opusfile qtbase qtdeclarative qtmultimedia toml11
49+
```ps
50+
vcpkg install dirent eigen3 fontconfig freetype harfbuzz libepoxy libogg libpng opus opusfile qtbase qtdeclarative qtmultimedia toml11
51+
```
52+
53+
If you also want Vulkan graphics support, you should also run this command:
54+
55+
```ps
56+
vcpkg install vulkan
57+
```
4958

50-
_Note:_ The `qt6` port in vcpkg has been split into multiple packages, build times are acceptable now.
51-
If you want, you can still use [the prebuilt version](https://www.qt.io/download-open-source/) instead.
52-
If you do so, include `-DCMAKE_PREFIX_PATH=<QT6 directory>` in the cmake configure command.
59+
_Note:_ The `qt` port in vcpkg has been split into multiple packages, build times are acceptable now. If you want, you can still use [the prebuilt version](https://www.qt.io/download-open-source/) instead. If you do so, include `-DCMAKE_PREFIX_PATH=<QT6 directory>` in the cmake configure command.
5360

54-
_Note:_ If you are planning to build the 64-bit version of openage, you are going to need 64-bit libraries.
55-
Add command line option `--triplet x64-windows` to the above command or add the environment variable `VCPKG_DEFAULT_TRIPLET=x64-windows` to build x64 libraries. [See here](https://github.com/Microsoft/vcpkg/issues/1254)
61+
_Note:_ If you are planning to build the 64-bit version of openage, you are going to need 64-bit libraries. Add command line option `--triplet x64-windows` to the above command or add the environment variable `VCPKG_DEFAULT_TRIPLET=x64-windows` to build x64 libraries. [See here](https://github.com/Microsoft/vcpkg/issues/1254)
5662

5763
<!---
5864
__NOTE:__ You can also download the pre-built vcpkg dependencies (without Qt) [from this repository](https://github.com/simonsan/openage-win-dependencies/releases).
5965
-->
6066

6167
## Building openage
62-
Note that openage doesn't support completely out-of-source-tree builds yet.
63-
We will, however, use a separate `build` directory to build the binaries.
68+
Note that openage doesn't support completely out-of-source-tree builds yet. We will, however, use a separate `build` directory to build the binaries.
6469

65-
_Note:_ You will also need to set up [the dependencies for Nyan](https://github.com/SFTtech/nyan/blob/master/doc/building.md#windows), which is mainly [flex](https://sourceforge.net/projects/winflexbison/)
70+
_Note:_ You will also need to set up [the dependencies for nyan](https://github.com/SFTtech/nyan/blob/master/doc/building.md#windows), which is mainly [flex](https://sourceforge.net/projects/winflexbison/).
6671

6772
Open a command prompt at `<openage directory>`:
6873

69-
mkdir build
70-
cd build
71-
cmake -DCMAKE_TOOLCHAIN_FILE=<vcpkg directory>\scripts\buildsystems\vcpkg.cmake ..
72-
cmake --build . --config RelWithDebInfo -- /nologo /m /v:m
74+
```ps
75+
mkdir build
76+
cd build
77+
cmake -DCMAKE_TOOLCHAIN_FILE=<vcpkg directory>\scripts\buildsystems\vcpkg.cmake ..
78+
cmake --build . --config RelWithDebInfo -- /nologo /m /v:m
79+
```
7380

7481
_Note:_ If you want to build the x64 version, please add `-G "Visual Studio 17 2022" -A x64` (for VS2022) to the first cmake command.
7582

7683
_Note:_ If you want to download and build Nyan automatically add `-DDOWNLOAD_NYAN=YES -DFLEX_EXECUTABLE=<path to win_flex.exe>` to the first cmake command.
7784

7885
## Running openage (in devmode)
79-
While this is straightforward on other platforms, there is still stuff to do to run openage on Windows:
80-
- Install the [DejaVu Book Font](https://dejavu-fonts.github.io/Download.html).
81-
- Download and extract the latest `dejavu-fonts-ttf` tarball/zip file.
82-
- Select all `ttf\DejaVuSerif*.ttf` files, right click and click `Install for all users`.
83-
84-
_Note:_ This will require administrator rights.
85-
- Set the `FONTCONFIG_PATH` environment variable to `<vcpkg directory>\installed\<relevant config>\tools\fontconfig\fonts\` or `<vcpkg directory>\installed\<relevant config>\etc\fonts\`.
86-
- Copy `fontconfig\57-dejavu-serif.conf` to `%FONTCONFIG_PATH%\conf.d`.
87-
- [Optional] Set the `AGE2DIR` environment variable to the AoE 2 installation directory.
88-
- Set `QML2_IMPORT_PATH` to `<vcpkg directory>\installed\<relevant config>\qml` or for prebuilt Qt `<qt directory>\<qt-version>\<compiler-version>\qml`
89-
- openage needs these DLL files to run:
90-
- `openage.dll` (Usually in `<openage directory>\build\libopenage\<config built>`.)
91-
- `nyan.dll` (The location depends on the procedure chosen to get nyan.)
92-
- DLLs from vcpkg-installed dependencies. Normally, these DLLs should be copied to `<openage directory>\build\libopenage\<config built>` during the build process. If they are not, you can find them in `<vcpkg directory>\installed\<relevant config>\bin`.
93-
- If prebuilt QT6 was installed, the original location of QT6 DLLs is `<QT6 directory>\bin`.
94-
95-
- Now, to run the openage:
96-
- Open a CMD window in `<openage directory>\build\` and run `python -m openage main`
97-
- Execute`<openage directory>\build\run.exe` every time after that and enjoy!
86+
While this is straightforward on other platforms, there is still stuff to do to run openage on Windows:
87+
88+
- Install the [DejaVu Book Font](https://dejavu-fonts.github.io/Download.html).
89+
- Download and extract the latest `dejavu-fonts-ttf` tarball/zip file.
90+
- Select all `ttf\DejaVuSerif*.ttf` files, right click and click `Install for all users`.
91+
_Note:_ This will require administrator rights.
92+
93+
- Set the `FONTCONFIG_PATH` environment variable to `<vcpkg directory>\installed\<relevant config>\tools\fontconfig\fonts\` or `<vcpkg directory>\installed\<relevant config>\etc\fonts\`.
94+
- Copy `fontconfig\57-dejavu-serif.conf` to `%FONTCONFIG_PATH%\conf.d`.
95+
- [Optional] Set the `AGE2DIR` environment variable to the AoE 2 installation directory.
96+
- Set `QML2_IMPORT_PATH` to `<vcpkg directory>\installed\<relevant config>\qml` or for prebuilt Qt `<qt directory>\<qt-version>\<compiler-version>\qml`
97+
- openage needs these DLL files to run:
98+
- `openage.dll` (Usually in `<openage directory>\build\libopenage\<config built>`.)
99+
- `nyan.dll` (The location depends on the procedure chosen to get nyan.)
100+
- DLLs from vcpkg-installed dependencies. Normally, these DLLs should be copied to `<openage directory>\build\libopenage\<config built>` during the build process. If they are not, you can find them in `<vcpkg directory>\installed\<relevant config>\bin`.
101+
- If prebuilt QT6 was installed, the original location of QT6 DLLs is `<QT6 directory>\bin`.
102+
103+
Now, to run openage:
104+
105+
- Open a CMD window in `<openage directory>\build\` and run `python -m openage main`
106+
- Execute`<openage directory>\build\run.exe` every time after that and enjoy!
98107

99108
## Packaging
100109

101-
- Install [NSIS](https://sourceforge.net/projects/nsis/files/latest/download).
102-
- Depending on the way you installed Qt (vcpkg/pre-built) you need to edit the following line in `<openage-repo-dir>\buildsystem\templates\ForwardVariables.cmake.in`:
110+
- Install [NSIS](https://sourceforge.net/projects/nsis/files/latest/download).
111+
- Depending on the way you installed Qt (vcpkg/pre-built) you need to edit the following line in `<openage-repo-dir>\buildsystem\templates\ForwardVariables.cmake.in`:
112+
103113
```
104-
# Use windeploy for packaging qt-prebuilt, standard value '1' for windeploy, '0' for vcpkg
105-
set(use_windeployqt 1)
114+
# Use windeploy for packaging qt-prebuilt, standard value '1' for windeploy, '0' for vcpkg
115+
set(use_windeployqt 1)
106116
```
107117

108-
Open a command prompt at `<openage directory>\build` (or use the one from the building step):
118+
Open a command prompt at `<openage directory>\build` (or use the one from the building step):
109119

120+
```ps
110121
cpack -C RelWithDebInfo
122+
```
111123

112-
The installer (`openage-<version>-<arch>.exe`) will be generated in the same directory.<br>
124+
The installer (`openage-<version>-<arch>.exe`) will be generated in the same directory.<br>
113125

114-
_Hint:_ Append `-V` to the `cpack` command for verbose output (it takes time to package all dependencies).
126+
_Note:_ Append `-V` to the `cpack` command for verbose output (it takes time to package all dependencies).
115127

116-
_Hint:_ <arch> you can set with the environment variable `TARGET_PLATFORM` (e.g. amd64, x86).
128+
_Note:_ <arch> you can set with the environment variable `TARGET_PLATFORM` (e.g. amd64, x86).

0 commit comments

Comments
 (0)