Repository navigation
Expand file tree
/
Copy pathINSTALL
More file actions
143 lines (112 loc) · 6.13 KB
/
Copy pathINSTALL
File metadata and controls
143 lines (112 loc) · 6.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
VANGERS: One for the Road
~~~~~~~~~~~~~~~~~~~~~~~~~
1. Required libraries:
- SDL 3.2 or newer
- SDL_net 3.2 or newer
- libvorbis
- SDL3-native clunk from the upstream `master` branch
(https://github.com/stalkerg/clunk)
- ffmpeg 6.0 or newer
- toml11 4.4.x
- zlib
2. Required tools:
- CMake 4.0 or newer
- Ninja or make
3. Building:
$ mkdir build
$ cd build
$ cmake ..
$ make
4. Running:
$ cd data
$ ../build/src/vangers
Windows (MSYS2) helper scripts
The OSS Windows build can be reproduced locally with the scripts in
packaging/msys2. They mirror the "OSS Windows 64bit Build" GitHub Actions job
and are split into three steps:
> powershell -ExecutionPolicy Bypass -File packaging\msys2\install-msys2.ps1
> powershell -ExecutionPolicy Bypass -File packaging\msys2\build-msys2.ps1
> powershell -ExecutionPolicy Bypass -File packaging\msys2\run-msys2.ps1 <game-dir>
install-msys2.ps1 installs MSYS2 automatically (into C:\msys64 by default) when
it is not present, updates it, and installs the required packages plus the pinned
clunk and toml11; use -Msys2Root, -NoInstallMsys2, -ClunkRepo, -ClunkCommit,
-Msys2Version, -Msys2InstallerUrl, -Msys2Sha256 and -NoUpdate to override the
defaults. build-msys2.ps1 only configures, builds and tests Vangers (use
-BuildType, -BuildDir and -SkipTests). run-msys2.ps1 copies the built binaries and
their MSYS2 runtime DLLs into <game-dir> and launches the game (add -NoRun to copy
only).
The underlying .sh scripts can also be run directly from an MSYS2 UCRT64 shell.
install-msys2.sh requires a completed full update: either run it as
`MSYS2_UPDATED=1 ./packaging/msys2/install-msys2.sh` after updating manually
(pacman -Syu, reopening the terminal if it updated msys2-runtime, then pacman -Syu
again), or use the PowerShell entry point, which drives the restart.
Windows (MSVC) prerequisites
a. Install Visual Studio 2022 or newer with the "Desktop development with C++"
workload (CMake and Ninja are included with the workload).
b. Install vcpkg and set VCPKG_ROOT to its directory:
https://learn.microsoft.com/vcpkg/get_started/get-started
Dependencies are declared in vcpkg.json (sdl3, sdl3-net, libogg, libvorbis,
zlib, toml11). Install them from the Vangers root into vcpkg_installed:
> vcpkg install --triplet x64-windows
c. Obtain an MSVC build of FFmpeg (6.0 or newer). Prebuilt shared packages
with headers and import libraries are available from
https://github.com/System233/ffmpeg-msvc-prebuilt (x64, LGPL). Extract the
archive and pass the prefix as -DFFMPEG_ROOT=<ffmpeg-prefix>. The helper
script below downloads it into external\ffmpeg automatically.
d. Build and install clunk with the MSVC toolchain from the upstream `master`
branch (https://github.com/stalkerg/clunk). clunk has no vcpkg manifest of
its own, so point it at the dependencies installed in step b; pass its
install prefix to Vangers as -DCLUNK_ROOT=<clunk-prefix>:
> git clone https://github.com/stalkerg/clunk.git external/clunk
> cmake -S external/clunk -B external/clunk/build -G Ninja ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_PREFIX_PATH=%CD%\vcpkg_installed\x64-windows ^
-DCMAKE_INSTALL_PREFIX=%CD%\external\clunk-install
> cmake --build external/clunk/build --parallel
> cmake --install external/clunk/build
e. Configure and build Vangers:
> cmake -S . -B build-msvc -G Ninja ^
-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake ^
-DVCPKG_INSTALLED_DIR=%CD%\vcpkg_installed ^
-DCMAKE_BUILD_TYPE=RelWithDebInfo ^
-DCLUNK_ROOT=%CD%\external\clunk-install ^
-DFFMPEG_ROOT=%CD%\external\ffmpeg
> cmake --build build-msvc --parallel
Note: the MSVC build currently links no executable icon. The committed
vangers.res was produced by windres as a 32-bit COFF object, which the x64
MSVC linker rejects (LNK1112), so MSVC builds skip the resource.
Debug builds use the same dependencies built in Debug: vcpkg installs the
debug packages (VCPKG_BUILD_TYPE=debug) and clunk is built with
-DCMAKE_BUILD_TYPE=Debug. For FFmpeg, use the "-develop" archive, which adds
the debug libraries under debug\ to the prefix, e.g.
ffmpeg-9.0.2_x64-windows-shared-lgpl-develop.zip.
The same steps are wrapped in helper scripts:
> powershell -ExecutionPolicy Bypass -File packaging\msvc\install-msvc.ps1
> powershell -ExecutionPolicy Bypass -File packaging\msvc\build-msvc.ps1
> powershell -ExecutionPolicy Bypass -File packaging\msvc\run-msvc.ps1 <game-dir>
install-msvc.ps1 installs the vcpkg dependencies, downloads a prebuilt FFmpeg
(the "-develop" archive for Debug) and clones/builds clunk into external\.
build-msvc.ps1 only configures and builds Vangers. Debug uses separate build
and install trees (build-msvc-debug, external\clunk-install-debug) so it never
mixes with the release DLLs; install and build both take -BuildType Debug.
Visual Studio and vcpkg must be installed beforehand.
run-msvc.ps1 copies the built game and its runtime DLLs into <game-dir> and
launches it (add -NoRun to copy without launching). install-msvc.ps1 accepts
-VcpkgRoot, -ClunkSrc, -ClunkRoot, -FfmpegRoot, -ClunkRepo, -ClunkCommit and
-BuildType; build-msvc.ps1 accepts -VcpkgRoot, -ClunkRoot, -FfmpegRoot,
-BuildDir and -BuildType; run-msvc.ps1 takes -BuildType to pick the DLLs.
OSX prerequisites
a. Install homebrew
b. brew install sdl3 sdl3_net libvorbis libogg ffmpeg toml11
c. Build/install the upstream `master` branch of clunk
(https://github.com/stalkerg/clunk).
d. Go to 3.
Android integration
The Android host project must provide native SDL3 and SDL3_net CMake packages,
for example through their official Prefab-enabled Android archives, and an
SDL3-native Clunk build. With `ANDROID` enabled this repository builds the
static `vangers` library and exports the standard SDL3 `SDL_main()` entry point
for the host activity's native entry point. The host build must also provide a
toml11 4.4.x CMake package. Save-game files keep their existing binary format.
User preferences migrate once from `options.dat` and `controls.dat` to
`settings.toml`; the legacy files are left unchanged.