Skip to content

Commit

Permalink
Polish COMPILING-VS-VCPKG.md with more thorough instructions. (Clever…
Browse files Browse the repository at this point in the history
  • Loading branch information
akrieger authored Feb 20, 2022
1 parent e54b46e commit 5822d67
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions doc/COMPILING/COMPILING-VS-VCPKG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,32 @@ Steps from current guide were tested on Windows 10 (64 bit), Visual Studio 2019

1. Install `Visual Studio` (installer can be downloaded from [Visual Studio homepage](https://visualstudio.microsoft.com/)).

- Select the "Desktop development with C++" and "Game development with C++" workloads.
- Select the "Desktop development with C++" and "Game development with C++" workloads.

2. Install `Git for Windows` (installer can be downloaded from [Git homepage](https://git-scm.com/)).

3. Install and configure `vcpkg`. If you already have `vcpkg` installed, you need to update it to at least commit `49b67d9cb856424ff69f10e7721aec5299624268` but not newer than `c0bc5e1b0ff27dd8710ee9ca18b708c0a9accce1` and rerun `.\bootstrap-vcpkg.bat` as described:

***WARNING: It is important that, wherever you decide to clone this repo, the path does not include whitespace. That is, `C:/dev/vcpkg` is acceptable, but `C:/dev test/vcpkg` is not.***

In a `cmd.exe` shell:
```cmd
REM cd to the appropriate folder first
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
git checkout 49b67d9cb856424ff69f10e7721aec5299624268
.\bootstrap-vcpkg.bat -disableMetrics
.\vcpkg integrate install
```
In a Git Bash shell, the commands are almost the same except the filesystem path separator is `/` instead of `\`.
```
# cd to the appropriate folder first
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
git checkout 49b67d9cb856424ff69f10e7721aec5299624268
./bootstrap-vcpkg.bat -disableMetrics
./vcpkg.exe integrate install
```

## Cloning and compilation:

Expand All @@ -48,9 +59,12 @@ cd Cataclysm-DDA

2. Open the provided solution (`msvc-full-features\Cataclysm-vcpkg-static.sln`) in `Visual Studio`.

- **Note:** If you are using Visual Studio 2022, the first time you open the solution, it will prompt you to "Retarget Projects". Unless you know what you are doing, hit cancel on this dialog.

3. Open the `Build > Configuration Manager` menu and adjust `Active solution configuration` and `Active solution platform` to match your intended target.

This will configure Visual Studio to compile the release version, with support for Sound, Tiles, and Localization (note, however, that language files themselves are not automatically compiled; this will be done later).
- The `Release` configuration and `x64` platform together make a good default setting. `Debug` is too slow and should be reserved for breakpoint debugging with code stepping.
- This will configure Visual Studio to compile the release version, with support for Sound, Tiles, and Localization (note, however, that language files themselves are not automatically compiled; this will be done later).

4. Start the build process by selecting either `Build > Build Solution` or `Build > Build > 1 Cataclysm-vcpkg-static`. The process may take a long period of time, so you'd better prepare a cup of coffee and some books in front of your computer :) The first build of each architecture will also download and install dependencies through vcpkg, which can take an especially long time.

Expand All @@ -60,7 +74,15 @@ Even if you do not need languages other than English, you may still want to exec

### Debugging

Ensure that the Cataclysm project (`Cataclysm-vcpkg-static`) is the selected startup project, configure the working directory in the project settings to `$(ProjectDir)..` (under Debugging section), and then press the debug button (or use the appropriate shortcut, e.g. F5).
1. Ensure that the Cataclysm project (`Cataclysm-vcpkg-static`) is the selected startup project.

- Right click the project in the Solution Explorer pane, select `Set as Startup Project`

2. Configure the working directory in the project settings to `$(ProjectDir)..`

- Right click the project in the Solution Explorer pane, select `Properties`
- Under `Configuration Properties > Debugging`, change `Working Directory` to `$(ProjectDir)..`
- **Note:** If you change configurations (eg from `Release` to `Debug`), you will have to repeat this step. You only have to do it once per configuration, the setting will persist.

If you discover that after pressing the debug button in Visual Studio, Cataclysm just exits after launch with return code 1, that is because of the wrong working directory.

Expand Down

0 comments on commit 5822d67

Please sign in to comment.