Our goal with compiler support is to make it as easy as possible for new contributors to get started with development of the game, while also using the newest compilers (and thus language standards) that we can.
To that end, we aim to support gcc and clang up to the newest stable versions and back to those shipping in any supported version of a popular distribution or relevant development environment, including Ubuntu, Debian, MSYS, and XCode.
Since macOS can be harder to update we have active developers and users on unsupported versions of macOS we would like to support. Newer macOS cannot compile for older macOS, so to support a reasonable number of users we aim to support at least 95% of users by macOS market share.
At the time of writing:
- Bionic is the oldest Ubuntu LTS, and defaults to g++ 7.3 or 7.5, depending on the platform, and clang 6.0.
- Debian stable is Buster, and defaults to g++ 8.3.
- Oldest supported Fedora is 33, which uses gcc 10.2.
- MSYS offers gcc 10.2.
- Code::Blocks offers g++ 8.1.
- macOS 10.12+ has 95.3% market share and that corresponds to XCode 8.3.
In practice, compiler support is often determined by what is covered in our automated testing.
At time of writing, the oldest relevant compiler is gcc 7.5, shipped in the Ubuntu Bionic LTS release. The default version is 7.3 only on platforms other than x86, and we deem it unlikely that potential users or developers would be using an Ubuntu LTS release on such a platform.
The limiting factor preventing us from using newer C++ features is currently XCode, where we would like to require 10.0 to get most C++17 features. That requires macOS 10.13 so we need to wait until macOS versions up to 10.12 drop below 5% market share (currently 7.4%).
To monitor macOS market share we have a helper script in tools/macos-market-share.py. Download the CSV-formatted data from statcounter and process it with that script to get a summary of cumulative market share as it varies across time. For example, this output:
2021-05 :: 10.11: 8.2 10.12: 11.0 10.13: 18.3 10.14: 27.0 10.15: 98.1
2021-06 :: 10.11: 6.6 10.12: 9.3 10.13: 16.3 10.14: 24.6 10.15: 99.0
2021-07 :: 10.11: 4.7 10.12: 7.4 10.13: 14.2 10.14: 22.1 10.15: 99.3
shows that cumulative market share for versions up to 10.11 first dropped below 5% in 2021-07, at which point we can (following the above guidelines) allow ourselves to drop support for 10.11.
We support and test gcc from version 7.5.
We support and test Clang from version 6.0.
We use Mingw for cross-compilation of Windows versions on Linux. gcc 9.3 is currently used both in the tests and for the Windows release binaries.
MSYS2 is a way to build the project on Windows. It currently offers gcc at versions 7 or higher.
MSYS also provides clang. We don't currently support using clang here, but work to that end is welcome.
We also support Visual Studio 2015 Update 3 and above.
We support macOS 10.12 and above, which effectively means XCode 8.3+.