1. Creates the missing `shared-dl` directory.
2. Unsets some environment variables that interfere with buildroot.
3. Disables `BR2_PER_PACKAGE_DIRECTORIES`, which prevented us
from using the partial sysroot build.
Also documents the `TOOLCHAIN=...` option in docs/building.md.
From GCC documentation:
> Perform interprocedural pointer analysis and interprocedural modification and reference analysis.
> This option can cause excessive memory and compile-time usage on large compilation units.
> It is not enabled by default at any optimization level.
Also forces the CMake generation to `make` because `ninja` gets into an
infinite loop for some reason on my laptop.
A PGO'd binary can be built as follows:
1. Build with `-DDEVILUTIONX_PROFILE_GENERATE=ON`.
3. Run the timedemo.
4. Build with `-DDEVILUTIONX_PROFILE_USE=ON`.
By default, the profile directory is at `${HOME}/devilutionx-profile`
Example for the RG99:
```bash
# Build the OPK for profiling data collection:
TOOLCHAIN=/opt/rs90-toolchain Packaging/OpenDingux/build.sh rg99 --profile-generate
# Copy the OPK to RG99:
scp -O build-rg99/devilutionx-rg99.opk rg99:/media/sdcard/apps
# Now, run the OPK. It will run the timedemo instead of the actual game and will take a couple of hours.
# ☕☕☕
# Copy the profiling data from RG99
scp -r -O rg99:/media/data/local/home/devilutionx-profile /tmp/devilutionx-profile
# Build the OPK use the collected profiling data:
TOOLCHAIN=/opt/rs90-toolchain Packaging/OpenDingux/build.sh rg99 --profile-use --profile-dir /tmp/devilutionx-profile
# Copy the resulting binary back to RG99
scp -O build-rg99/devilutionx-rg99.opk rg99:/media/sdcard/apps
```
`-O2` increases the binary size by 0.5 MiB which we can now afford.
Increasing buffer size to `768` improves performance (seems to be the
sweet spot).
15-20 FPS in dungeon on the max-mem OD fork.
1. Adds a `libdevilution_so` target when tests are enabled.
2. Each test file is now a separate binary target linked against `libdevilutionx_so` (can now run tests in parallel).
3. Tests are now defined in a separate `test/CMakeLists.txt` file.
4. Building the tests is now controlled by the standard `BUILD_TESTING` option (defined by CTest).
5. Tests are now built by default.
6. On CI, test errors are now reported.
Also:
* `.clang-format`: Enable SortIncludes in tests
* `path_test.cpp`: Fix -Wsign-compare
SDL_mixer can only stream a single music track
SDL_audiolib has unlimited streams.
With this change, we finally have streaming sounds (respecting
sfx_STREAM).
Audio options can now also be set via diablo.ini, which should help us
better diagnose the static noise issues.
Unfortunately, OD Beta has a major regression with SDL joystick support,
as it always reports buttons as keyboard keys instead of actual buttons.
This partially breaks external keyboard support, where e.g. space no
longer acts as expected.
However, on balance, OD Beta is better than the 2014 firmware at this
point.
I've recently done some massive updates to the buildroot, necessitating
some minor changes to the defconfig here.
Good news: The buildroot use GCC 5.4 and newer binutils, so it now
builds with LTO.
1. Now that all the buildroots we need are open-source,
use defconfigs that ship with them instead of rolling our own.
2. New script: Packagaging/OpenDingux/build-all.sh
3. To avoid polluting top-level home directory, buildroot location
changed to `~/devilutionx-buildroot/$BUILDROOT_TARGET`.
4. Move OPK packaging script to its own file. This is to be able
to make a package for devilutionX in the buildroot itself.
I've recently done some massive updates to the buildroot, necessitating
some minor changes to the defconfig here.
Good news: The buildroot use GCC 5.4 and newer binutils, so it now
builds with LTO.