CMake vs Meson, and how to get speed without a rewrite
Teams look at Meson or Muon when CMake configure feels slow. The cost of that move is a new build file in every directory.
Meson and Muon read meson.build files. Wefti reads existing CMakeLists.txt files and presets. In the v0.4.0 peer benchmark with 500 generated targets, a warm configure took 789 ms with Wefti and 1,645 ms with Meson. A reconfigure after an edit to a compiler definition in one directory took 220 ms with Wefti and 830 ms with Meson.
Why teams look at Meson
Meson has a small build language and writes Ninja files, and many teams find its files easy to read. The cost arrives when a project already uses CMake. A move needs a new meson.build file for each directory, new dependency lookups, and new answers for every preset, toolchain file, and IDE setup that the team uses today.
Muon is a separate implementation of Meson written in C. It reads the same meson.build files, so a move to Muon needs the same rewrite.
| Area | Wefti 0.4.0 | CMake 4.5.1 | Meson |
|---|---|---|---|
| Project input | CMakeLists.txt, presets | CMakeLists.txt, presets | meson.build |
| Rewrite from CMake | None | None | Every build file |
| Packages | Existing CMake integrations for vcpkg, Conan, and FetchContent | CMake toolchains | Subprojects and Conan MesonToolchain |
| Output | Ninja, Makefiles, Xcode, Visual Studio | Ninja, Makefiles, IDE projects | Ninja, IDE backends |
| Developer tools | wefti-lsp, fmt, lint --fix, explain, graph | File API, trace, debugger | Introspection |
| Reconfigure after a leaf edit with 500 targets | 220 ms | 566 ms | 830 ms |
Sources
The peer benchmark includes Meson setup times. The Meson column comes from Meson dependencies and Conan for Meson.
What Wefti keeps and what it adds
Wefti is a native Rust engine for CMake 4.5.1. Your build files do not change, so a switch is easy to undo.
- Your
CMakeLists.txtfiles,CMakePresets.json(schema v13), toolchain files, andfind_package()setup stay as they are. - vcpkg and Conan keep working through their CMake integrations. Wefti v0.4.0 matched CMake on 1,518 / 1,518 scored vcpkg ports and passed 2 / 2 Conan scenarios.
- Wefti writes Ninja, Unix Makefiles, Xcode, and Visual Studio files, and it writes
compile_commands.jsonforclangd. - Native mode runs compiler probes in parallel, shares a probe cache, replays unchanged directories, and skips unchanged Ninja generation.
With 100 targets, a reconfigure after a leaf edit took 62 ms with Wefti, 159 ms with CMake, and 414 ms with Meson. Wefti had a lower median than CMake in all six cases. The benchmark measured cold configure, warm configure, and leaf edits at both target counts. Each case used five runs on macOS arm64. See the peer benchmark.
Use wefti build to run the generated Ninja rules without installing Ninja. The names cmake, ctest, cpack, and ccmake use CMake 4.5.1 compatibility mode. For test and dependency commands, see the native workflow tools.
Try Wefti on your CMake project
Run these steps on a copy of your project. Your files stay unchanged, so you can go back to CMake at any time.
- Install Wefti. Use the release installer, Homebrew, Scoop, or Nix. Add
--alias-cmaketo the installer if you wantcmake,ctest,cpack, andccmaketo run Wefti. - Check parity on a copy. Run
wefti verifywith your own CMake 4.5.1 binary. It compares the configure result, codemodel, cache,compile_commands.json, and the Ninja dry run. - Configure with the native command. Run
wefti -S . -B build -G Ninja. Native mode turns on the probe cache and replay. - Build with your usual commands. Run
cmake --build buildandctest --test-dir build. Nothing in the project changes. - Configure again. Repeat step 3 with a new build directory and then with the same one. The probe cache and replay act on the repeats.
wefti verify --oracle /path/to/cmake-4.5.1 -- -S . -G Ninja
wefti -S . -B build -G Ninja
cmake --build build
wefti -S . -B build2 -G Ninja
When Meson is the better choice
- Wefti
- You want to keep CMake files, presets, vcpkg, and Conan, and you want a faster configure with more tools.
- CMake
- You need a generator or behavior outside the tested Wefti scope, such as
cmake-gui. - Meson or Muon
- You start a new project, you have no CMake dependencies, and your team wants to maintain
meson.buildfiles.
Frequently asked questions
Is Meson faster than CMake?
For 500 generated targets, Meson took 1,645 ms on a warm configure and 830 ms to reconfigure after a leaf edit. CMake took 1,156 ms and 566 ms, and Wefti took 789 ms and 220 ms. These are medians from five runs on macOS arm64.
Can I switch from CMake to Meson without rewriting the build?
No. A full move needs meson.build files. Meson can consume some CMake subprojects, but the top-level project still needs Meson files.
What is Muon?
Muon is an implementation of Meson written in C. It reads meson.build files, so a move from CMake to Muon needs the same rewrite as a move to Meson.
Does Wefti work with vcpkg and Conan?
Yes, through the existing CMake integrations. Wefti v0.4.0 matched CMake on 1,518 / 1,518 scored vcpkg ports and passed 2 / 2 Conan scenarios.
How do I get a faster configure and keep CMake?
Configure with the native wefti command. The names cmake, ctest, cpack, and ccmake select compatibility mode, which behaves like CMake 4.5.1, keeps replay off, and keeps the probe cache off unless you set WEFTI_PROBE_CACHE=on.
When should I choose Meson instead of Wefti?
Choose Meson for a new project when your team wants to maintain meson.build files. If your project already uses CMake, run wefti verify to compare configure results and outputs. In v0.4.0, 72 of 77 eligible repositories in the sealed holdout passed those strict checks (93.51%).