supertux
supertux copied to clipboard
Move SuperTux to C++20
This is restoring #1602 back into a compilable state. Let's see what breaks.
Everything outside of UBPorts compiles with C++20 set. UBPorts is a bit problematic, as it's stuck on an ancient Ubuntu 16.04, which is EOL in a week. No idea how far away the UBPorts 20.04 update is or if there are any PPAs that could give us a newer gcc/clang on that system. UBPorts doesn't support C++17 either.
Consideration: Ubuntu 18.04 can no longer compile SuperTux out of the box. Neither CMake nor the default GCC, as given by the repositories, support C++20; for the compiler, Canonical provides later versions of Clang; for CMake, I couldn't find later versions that support C++20.
I have no idea how other distros are affected, as I only run Ubuntu 18.04 and 20.04.
I am not too worried about Ubuntu 18.04, as newer compiler are easily available from PPA and we have appimage/flatpak/guix packages on top of that.
But UBPorts will be difficult, as there doesn't seem to be an easy way to get a new compiler onto that. We might need to compile one ourselves.
Related:
I've investigated supporting the Steam Linux Runtime to fix #2112 and #2083, everything went well until the compilation hit the missing Boost dependencies. It appears SLR doesn't include Boost, and the documentation instructs not to add any extra dependency.
Since this PR seems to remove all dependencies to Boost, I believe I'll have to wait until this gets merged before resuming my work on the Steam version.
This is probably replaced by #2473
Since #2473 was merged a while ago and this PR has a lot of conflicts it was decided to close this PR. Personally I think that it's to early to move to C++20, maybe in 1.5 years when compilers supporting C++20 will be available on more systems.