Toolchains and platforms
The clang toolchain a game module compiles with, the versions Engine/Config/Toolchains.ini pins, how mbt finds it, and where each platform stands.
mbt compiles your C++ modules with Clang. On Windows that is clang-cl, lld-link and llvm-lib, building against the Microsoft C++ standard library, C runtime and Windows SDK; cl.exe and link.exe never run. The engine's own modules come prebuilt with the install, so the toolchain only has to match them.
Platform status
| Platform | --platform | Architecture | Status |
|---|---|---|---|
| Windows | win-x64 | x64 | The platform the installed editor build runs on. Builds, runs and packages |
| macOS | osx-arm64 | arm64 | In development No installed build yet |
| Linux | linux-x64 | x64 | In development No installed build yet; the engine does not link on Linux |
The platforms page lists the graphics API each platform uses.
Pinned versions
Engine/Config/Toolchains.ini in the install pins the versions the engine was built with Engine/Config/Toolchains.ini:
| Section | What it pins | Minimum | Preferred |
|---|---|---|---|
[LLVM] | clang-cl and lld-link | 20.1 | 23 |
[MsvcToolset] | The Visual C++ standard library, C runtime and libraries clang-cl compiles against (not the compiler) | 14.38 | 14.51 |
[WindowsSdk] | The Windows SDK | 10.0.22621.0 | 10.0.26100.0 |
Below the minimum is an error and the build refuses it. Between the minimum and the preferred version builds with a warning. A preferred version given as a prefix (23) matches every version under it. A section can also list +BannedVersions with a reason, which is an error even above the minimum.
How mbt finds a toolchain
LLVM is searched in this order: the Path in [LLVM] or the LLVM_PATH environment variable, the LLVM bundled with each Visual Studio installation, Program Files\LLVM, then PATH. When several installations qualify, the preferred version wins over a newer one. A pinned path is used as given; if it does not hold a complete LLVM, the build fails instead of falling back to another compiler.
The Visual C++ toolset and the Windows SDK are found through vswhere and the Windows Kits folders, and the pinned versions are picked. Install Visual Studio or the Build Tools with the Desktop development with C++ workload for those libraries, plus LLVM (the copy Visual Studio can install works).
mbt doctor checks every installation it finds against the pins and reports the optional tools it can use.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| A toolchain below the minimum, or none found | Install the pinned LLVM, or set LLVM_PATH; run mbt doctor |
| The Visual C++ libraries or the Windows SDK are missing | Add the C++ workload in the Visual Studio installer |
Unknown --platform | Use win-x64 |
Related
Engine sources
This page describes behavior implemented in these files of the engine repository, checked against commit 3f3a08d31.
- Engine/Config/Toolchains.ini