CMake vs Muon and Premake, and how to get the fastest configure you can measure
Muon reads meson.build files, and Premake5 reads premake5.lua files. Wefti and CMake read CMakeLists.txt files. With 500 generated targets, the median time after an edit in one directory was 220 ms for Wefti v0.4.0, 566 ms for CMake, 211 ms for Muon, and 952 ms for Premake5.
Why Muon and Premake come up
Muon is a C implementation of Meson. It reads the same meson.build files, so it needs the same rewrite as Meson. Premake5 describes a project in Lua, writes Makefiles and IDE projects, and leaves package management to you. Each tool is small and quick to start, and each asks you to replace the build files that CMake reads today.
| Area | Wefti 0.4.0 | CMake 4.5.1 | Muon | Premake5 |
|---|---|---|---|---|
| Project input | CMakeLists.txt, presets | CMakeLists.txt, presets | meson.build | premake5.lua |
| Rewrite from CMake | None | None | Every build file | Every build file |
| Packages | Existing CMake integrations for vcpkg, Conan, and FetchContent | CMake toolchains | Set in meson.build | You manage them |
| Output | Ninja, Makefiles, Xcode, Visual Studio | Ninja, Makefiles, IDE projects | Ninja files | IDE projects and Makefiles |
| ctest, cpack, and ccmake | Yes | Yes | No | No |
Configure times for 100 and 500 targets
Wefti had a lower median than CMake in all six comparisons. Muon, a C implementation of the Meson language, had lower cold, warm, and leaf edit medians than Wefti at both target counts. Premake5 generates files without probing the compiler.
The benchmark used five runs for each tool and target count. Cold runs started with an empty build directory and empty tool caches. Warm runs started with an empty build directory and kept the tool caches. The leaf edit changed a compiler definition in one directory. The memory column gives the highest resident memory use of a single process during cold configure.
| Targets | Tool | Cold (ms) | Warm (ms) | Leaf edit (ms) | Peak memory (MiB) |
|---|---|---|---|---|---|
| 100 | Wefti | 637 | 277 | 62 | 37.9 |
| 100 | CMake | 646 | 604 | 159 | 37.8 |
| 100 | Muon | 231 | 232 | 50 | 36.9 |
| 100 | Premake5 | 197 | 196 | 187 | 21.3 |
| 100 | Meson | 1,174 | 1,199 | 414 | 50.1 |
| 100 | XMake | 1,605 | 1,604 | 1,597 | 44.8 |
| 500 | Wefti | 1,109 | 789 | 220 | 66.7 |
| 500 | CMake | 1,141 | 1,156 | 566 | 82.3 |
| 500 | Muon | 423 | 417 | 211 | 37.1 |
| 500 | Premake5 | 1,045 | 1,050 | 952 | 61.2 |
| 500 | Meson | 1,651 | 1,645 | 830 | 64.5 |
| 500 | XMake | 3,517 | 3,484 | 3,484 | 105.0 |
Time every tool yourself
The script generates one C and C++ project and writes the same sources and matching build files for every tool. It measures a cold configure, a warm configure, and an incremental reconfigure after a leaf edit. It also records peak memory, executable size, and installed size, and it reports a tool that is not installed as unavailable. Every tool writes Ninja files.
python3 tools/measure/bench_alternatives.py --targets 100,500 --runs 5 --leaf-edit define --out-json bench-alt.json --out-md bench-alt.md
Run it with your own install of each tool. The peer benchmark gives the full results.
Which tool should I pick?
- Wefti
- Keep your CMake files, presets, and packages. Use
wefti buildto run the generated Ninja rules with the built-in executor. The namescmake,ctest,cpack, andccmakeuse CMake 4.5.1 compatibility mode. - CMake
- You need
cmake-gui, an omitted legacy generator, or behavior outside the tested Wefti scope. - Muon
- You have a Meson project and want to avoid a Python dependency. The CMake vs Meson guide covers the Meson side.
- Premake5
- You need generated Visual Studio or Xcode files from a Lua script. The Xmake, Premake, and GN guide compares it with other small tools.
Frequently asked questions
What is the difference between CMake and Muon?
CMake reads CMakeLists.txt. Muon is a C implementation of Meson and reads meson.build, so it needs a different set of build files. Wefti runs the CMake files that you already have.
Is Muon faster than CMake?
Yes, in this peer benchmark. With 500 generated targets, the median times for Muon were 423 ms cold, 417 ms warm, and 211 ms after a leaf edit. The times for CMake were 1,141 ms cold, 1,156 ms warm, and 566 ms after a leaf edit. The tools read different build files.
How does Premake compare with CMake?
Premake5 writes Makefiles and IDE projects from Lua scripts and leaves packages to you. CMake and Wefti also run tests with ctest and build packages with cpack.
What is the fastest C++ build configure?
The result depends on the project and the configure phase. With 500 generated targets, Muon had the lowest median in each phase. Wefti had the lower median in each phase among the two tools that read CMake project files. Premake5 generates files without probing the compiler.
Is there a Meson or Muon alternative for CMake projects?
Yes, Wefti. It reads your CMakeLists.txt, presets, vcpkg, and Conan setup, so a CMake project gets a Rust configure engine without a rewrite.
When should I choose Muon or Premake instead of Wefti?
Choose Muon for a Meson project when you want to avoid a Python dependency. Choose Premake5 to generate Visual Studio or Xcode projects from Lua. If your project uses CMake, run wefti verify before switching to Wefti. In v0.4.0, 72 of 77 eligible repositories (93.51%) in the sealed blind holdout matched CMake under the strict L1 configure checks.