Configuring the toolchain
According to a blog post on Kitware's page (see the Further Reading section), CMake supports modules as early as version 3.25. Despite the fact that 3.28 makes the feature officially supported, this isn’t the only piece of the puzzle that we have to get right to enjoy the convenience of modules.
The next requirement focuses on the build system: it needs to support dynamic dependencies. As of now, you have only two choices:
- Ninja 1.11 and newer (Ninja and Ninja Multi-Config)
- Visual Studio 17 2022 and newer
Similarly, your compiler needs to produce files that map source dependencies for CMake in a specific format. This format is described in a paper written by Kitware developers known as p1589r5
. This paper has been submitted to all major compilers for implementation. Currently, only three compilers have managed to implement the required format:
- Clang 16
- MSVC in Visual Studio 2022 17.4 (19.34).
- GCC 14 (for the in-development branch, after 2023-09...