Skip to content

Commit 877e1ac

Browse files
committed
Use vcpkg for all platform presets
1 parent 6b41152 commit 877e1ac

File tree

5 files changed

+23
-16
lines changed

5 files changed

+23
-16
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,25 @@ jobs:
6666
run: |
6767
sudo apt update
6868
sudo apt install -y --no-install-recommends \
69-
ninja-build cmake g++ libgtest-dev libsdl2-dev zlib1g-dev libspdlog-dev
69+
ninja-build cmake g++ libspdlog-dev
7070
7171
- name: Install Windows dependencies
7272
if: ${{ matrix.os.runner == 'windows-latest' }}
7373
run: choco install ninja
74-
74+
7575
- uses: ilammy/msvc-dev-cmd@v1
7676
if: ${{ matrix.os.runner == 'windows-latest' }}
7777
with:
7878
arch: win64
7979

80+
- uses: lukka/run-vcpkg@v11
81+
with:
82+
vcpkgGitCommitId: 2e7fd315d713e9eac52f6bdb24afbf1b4dbbe1e5
83+
8084
- name: Configure CMake
8185
env:
8286
CC: ${{ matrix.os.cc }}
8387
CXX: ${{ matrix.os.cxx }}
84-
VCPKG_ROOT: C:/vcpkg
8588
run: cmake --preset ${{ matrix.os.preset }} -DBUILD_TESTING=ON -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON -DBUILD_EDITOR=ON
8689

8790
- name: Build ${{ matrix.build_type }}

Brewfile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
# Homebrew dependencies to build Descent3
22

3-
# SDL
4-
brew "sdl2"
5-
63
brew "cmake"
7-
brew "googletest"
84
brew "ninja"
9-
10-
# zlib
11-
brew "zlib"

CMakePresets.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
{
55
"name": "defaults",
66
"hidden": true,
7-
"binaryDir": "${sourceDir}/builds/${presetName}"
7+
"binaryDir": "${sourceDir}/builds/${presetName}",
8+
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
89
},
910
{
1011
"name": "win",
@@ -21,8 +22,7 @@
2122
"architecture": {
2223
"strategy": "external",
2324
"value": "x64"
24-
},
25-
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
25+
}
2626
},
2727
{
2828
"name": "mac",

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ The milestone needs testing on all platforms. Please report issues when found.
9292
- D3 Open Source compiles level scripts in their own hogfiles. Make sure you copy and overwrite `d3-{platform}.hog`.
9393

9494
## Building
95+
#### Prerequisites
96+
1. [**vcpkg**](https://github.com/microsoft/vcpkg)
97+
This project depends on [`vcpkg`](https://github.com/microsoft/vcpkg), a cross-platform dependency-management system developed by Microsoft. You will need to install it locally by cloning https://github.com/microsoft/vcpkg and setting your `VCPKG_ROOT` env var to the repository location.
98+
9599
#### Building - Windows
96100
1. Make sure that you have Git and Visual Studio 2022 with the “Desktop development with C++” workload. If you don’t already have those installed or you aren’t sure, then open an elevated Command Prompt and run:
97101

@@ -146,7 +150,7 @@ Run these commands:
146150
147151
```sh
148152
sudo apt update
149-
sudo apt install -y --no-install-recommends git ninja-build cmake g++ libsdl2-dev zlib1g-dev
153+
sudo apt install -y --no-install-recommends git ninja-build cmake g++
150154
git clone https://github.com/DescentDevelopers/Descent3
151155
cd Descent3
152156
cmake --preset linux -D ENABLE_LOGGER=[ON|OFF]
@@ -160,7 +164,7 @@ Run these commands:
160164

161165
```sh
162166
sudo dnf update --refresh
163-
sudo dnf install -y git ninja-build cmake gcc-c++ SDL2-devel zlib-devel
167+
sudo dnf install -y git ninja-build cmake gcc-c++
164168
git clone https://github.com/DescentDevelopers/Descent3
165169
cd Descent3
166170
cmake --preset linux -D ENABLE_LOGGER=[ON|OFF]

vcpkg.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
"zlib",
66
{
77
"name": "sdl2",
8-
"version>=": "2.30.1"
8+
"version>=": "2.30.1",
9+
"features": ["x11","wayland"],
10+
"platform": "linux"
11+
},
12+
{
13+
"name": "sdl2",
14+
"version>=": "2.30.1",
15+
"platform": "!linux"
916
}
1017
]
1118
}

0 commit comments

Comments
 (0)