Overhaul dependency options

Changes how dependency options are handled and moves them out of
`CMakeLists.txt`.

Major changes:

1. The static default now takes `TARGET_SUPPORTS_SHARED_LIBS` into account
2. The `DIST` setting no longer affects the static default.
3. The static option is now visible for system dependencies as well.
   (it was previously hidden by `cmake_dependent_option`).
4. The auto-detection mechanism for `libfmt` and `SDL_image` only
   applies if the setting has not been set.
5. SDL2 on Android is now also linked statically,
   resulting in a 1.1 MiB smaller APK.

When using non-system dependencies, the default should always be static,
as there are 2 main use cases for these:

1. Dependencies that we must currently vendor because our forks have
   significant changes that are not yet merged/released upstream.
2. Platforms that have no system packages, such as Android and iOS.

In both cases, static linking is the most appropriate default.
This commit is contained in:
Gleb Mazovetskiy 2021-12-06 20:52:59 +00:00 committed by Anders Jenbo
commit 75222ccef8
15 changed files with 387 additions and 306 deletions

View file

@ -9,9 +9,9 @@
#include <memory>
#include <SDL.h>
#include <pkware.h>
#include "encrypt.h"
#include "pkware.h"
namespace devilution {