-
Notifications
You must be signed in to change notification settings - Fork 29
/
BUILD.txt
executable file
·93 lines (62 loc) · 3.5 KB
/
BUILD.txt
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
* Windows
To compile in Windows, you can use CMake or open the folder with Visual Studio 2022.
The easiest way to get the required dependencies is to use vcpkg.
vcpkg install physfs sfml ffmpeg --triplet=x86-windows
vcpkg install physfs sfml ffmpeg --triplet=x86-windows-static
vcpkg install physfs sfml ffmpeg --triplet=x64-windows
vcpkg install physfs sfml ffmpeg --triplet=x64-windows-static
There is a custom vcpkg triplet that links ffmpeg dynamically.
vcpkg install physfs sfml ffmpeg --triplet=x86-windows-static --overlay-triplets=vcpkg/triplets
vcpkg install physfs sfml ffmpeg --triplet=x64-windows-static --overlay-triplets=vcpkg/triplets
PhysicsFS - https://icculus.org/physfs
version >= 2.1
SFML - https://www.sfml-dev.org/
SFML 2.6.0
FFmpeg - https://ffmpeg.zeranoe.com/builds/
Get both shared and dev packages (version 3.x or 4.x)
* Linux
To compile in Linux (Ubuntu), you need gcc or clang with C++20 support
and to have both PhysicsFS >= 2.1 and SFML >= 2.6 installed.
Because SFML 2.6 is not yet released, you need to install it from source:
https://github.com/SFML/SFML/tree/2.6.0
For Ubuntu, you can see which dependencies are required by analysing the CI build scripts
under .github\workflows\*.yml
sudo apt install libphysfs-dev
sudo apt install libsfml-dev (skip this step until SFML 2.6 is released)
Optional (for movie support) FFmpeg:
sudo apt install libavdevice-dev libavformat-dev libavfilter-dev libavcodec-dev libswscale-dev libavutil-dev
* CMake
A CMake project file is provided.
Movie support is enabled by default, unless FFmpeg isn't found.
It will generate a project to compile on the target platform.
cmake CMakeLists.txt
cmake CMakeLists.txt -DDGENGINE_MOVIE_SUPPORT:BOOL=FALSE
Both PhysicsFS and SFML must be installed.
FFmpeg is also required for movie support.
For logging support: spdlog
For testing support: catch2
All the CMake properties and default values:
DGENGINE_BUILD_TEST_SUITE (FALSE) Build Tests
DGENGINE_ENABLE_LOGGING (FALSE) Enable Logging in release builds
DGENGINE_MOVIE_SUPPORT (TRUE) Enable Movie support
DGENGINE_FALLBACK_TO_LOWERCASE (TRUE) Enable falling back to all lowercase names if file is not found
DGENGINE_STATIC_CRT (FALSE) Use static CRT library (Windows)
DGENGINE_COMPRESS_BINARY (FALSE) Compress binary with UPX
DGENGINE_OPTIMISE (FALSE) Optimize build with compiler flags
DGENGINE_DIABLO_FORMAT_SUPPORT (TRUE) Enable Diablo 1-2 file format support
DGENGINE_MPQ_SUPPORT (TRUE) Enable physfs MPQ support
DGENGINE_INTERNAL_STORMLIB (TRUE) Use internal StormLib for MPQ support
DGENGINE_EXTERNAL_STORMLIB (FALSE) Use external StormLib for MPQ support
DGENGINE_DYNAMIC_STORMLIB (TRUE) Use external StormLib dll for MPQ support
* PhysicsFS with MPQ file support
A built-in MPQ v1 implementation is provided based on StormLib
by Ladislav Zezula.
https://github.com/ladislav-zezula/StormLib
To use an external (full featured) StormLib when installing, run like this:
cmake CMakeLists.txt -DDGENGINE_EXTERNAL_STORMLIB:BOOL=TRUE
The full featured StormLib is required to load Diablo 2 MPQ files.
By default, DGEngine tries to use an external StormLib.dll/libstorm.so
instead of the built-in implementation. To disable this behavior, run like this:
cmake CMakeLists.txt -DDGENGINE_DYNAMIC_STORMLIB:BOOL=FALSE
If StormLib.dll/libstorm.so isn't found, the built-in implementation is used.
In Windows, the StormLib.dll must be built with Multi-Byte Character Set, not Unicode.