Compilers
| Compiler | C++20 Modules | Info |
|---|---|---|
| MSVC 2022 | ✅ (17.6) | |
| Clang | ✅ (22) | |
| Apple Clang | ❌ | |
| GCC | ✅ (15) |
Standard Libraries
| Standard Library | Provides import std; | Info |
|---|---|---|
| MSSTL | ✅ (17.10) | |
| libc++ | ✅ (18) | |
| libstdc++ | ✅ (15) |
Build Tools
| Tool | C++20 Modules | import std; | Header Units | Info |
|---|---|---|---|---|
| Ninja | ✅ 1.11 | ✅ 1.11 | ❌ | |
| MSBuild | ✅ | ✅ | ❌ | |
| CMake | ✅ 3.28 | ⚙️ 3.30 | ❌ | Support for import std; is experimental (blog post). |
| XMake | ✅ | ✅ | ✅ | Release |
| Zork++ | ✅ | ✅ | ❌ | Project |
| Build2 | ✅ | ✅ 0.17.0 | ❌ | Issue Link |
| qbs | ✅ 2.5 | ✅ 3.1 | ❌ | Tutorial |
| Meson | Partial | ❌ | ❌ | Issue Link |
| Gnu Make | ✅ | ❌ | ❌ | Demo Project |
| Cabin | ❌ | ❌ | ❌ | |
| HMake | ✅ | ✅ | ✅ | |
| GNU Autotools | ❌ | ❌ | ❌ | |
| Scons | ⚙️ | ❌ | ❌ | PR for GCC support |
| ccache | ⚙️ | ❌ | ❌ | PR |
| sccache (clang) | ✅ | ✅ | ❌ | |
| sccache (gcc/MSVC) | ❌ | ❌ | ❌ | |
| Bazel | ✅ | ⚙️ | ❌ | Issue Link |
| Gradle | ❌ | ❌ | ❌ | Issue Link |
| fastbuild | ❌ | ❌ | ❌ | Issue Link |
| qmake | ❌ | ❌ | ❌ | 💀 Deprecated and should no longer be used! |
Language Server (IDE Support)
| Tool | C++20 Modules | Info |
|---|---|---|
| Clangd | ✅ | C++20 Modules in clangd |
| vscode-cmake-tools | ❌ | Issue Link |
Static analyzers
| Tool | C++20 Modules | import std; | Header Units | Info |
|---|---|---|---|---|
| Sonar | Experimental | ✅ | ❌ | Modules documentation |
Preprocessor
| Tool | C++20 Modules | Info |
|---|---|---|
| Qt moc | ⚙️ (6.12) | Update Sep 2026: Qt 6.12 adds basic C++ modules support to moc. When moc’ing module interfaces and partitions, the generated cpp file is now made part of the respective module. Q_OBJECT & friends are still not supported in implementation units and private module fragments. There is still a lot of work to be done (tracked in QTBUG-86697), and most other Qt modules will likely need small fixes to work with modules as well.As abbapoh points out, modules have so far been tested with Qt Creator as a proof of concept; there are currently no plans to add modules support to qtbase itself. The moc machinery has also been back-ported to Qbs, so modules should work with older Qt versions when building with Qbs. The same could probably be done with CMake, although it requires knowing the includes in order to patch the generated file properly. Background: the last mailing-list conversation happened mid December 2023 here, where fabiankosmale laid out the challenges. |