On CMake v3.28+, `EXCLUDE_FROM_ALL` is supported natively as an argument
to `FetchContent_Declare`.
On CMake v3.30+, `FetchContent_Populate`, which we use to polyfill
`EXCLUDE_FROM_ALL` support for older versions of CMake, is deprecated
and triggers a noisy warning.
Avoids the warning by using the native `EXCLUDE_FROM_ALL` support on
CMake v3.28+.
With this flag (off by default), all of the dependencies are packaged
into the source archive (including SDL2 etc).
Useful for building on machines without an internet connection.
1. Platform and toolchain files are now all under `platforms/`, with a
single `CMake/platforms/${platform}.cmake` per platform.
2. Custom functions/macros are under `functions/`.
3. Finder modules are in `/finders`.
This commit serves 2 purposes:
1. Fixes CMake 3.13 compatibility when using
` -DDEVILUTIONX_SYSTEM_LIBSODIUM=OFF` (fixes#1222).
2. Ensures we do not build targets that are not depended on by us,
by passing `EXCLUDE_FROM_ALL` to `add_subdirectory`.
Adds an option to build libsodium from source instead of using the
system-provided one.
This is useful on systems that do not provide libsodium, or for testing
changes to libsodium along with devilutionx (by specifying
`-DFETCHCONTENT_SOURCE_DIR_LIBSODIUM`).
This also allows us to configure sodium to our liking when building it from source,
such as `SODIUM_MINIMAL`, which reduces the x64 release binary size from 4.3 MiB to 4.1 MiB.