Wefti

CMake vs Xmake, Premake, GN, and Muon

Xmake, Premake5, GN, and Muon each need their own build files. CMake and Wefti read CMakeLists.txt. Wefti can use existing CMake presets, toolchains, and package integrations.

How the tools differ

Each tool trades something. Xmake and Premake use Lua scripts. GN is the meta-build system of Chromium and writes Ninja files. Muon reads meson.build files and is written in C. CMake and Wefti read CMakeLists.txt and cover the widest set of packages and generators.

Lightweight C and C++ build tools
AreaWefti 0.4.0CMake 4.5.1XmakePremake5GNMuon
Project inputCMakeLists.txt, presetsCMakeLists.txt, presetsxmake.luapremake5.luaBUILD.gnmeson.build
Rewrite from CMakeNoneNoneYesYesYesYes
OutputNinja, Makefiles, Xcode, Visual StudioNinja, Makefiles, IDE projectsBuilds itself or generates projectsIDE projects and MakefilesNinja filesNinja files
ctest, cpack, and ccmakeYesYesNoNoNoNo
PackagesExisting CMake integrationsCMake toolchainsxmake-repo, vcpkg, ConanYou manage themYou manage themSet in meson.build
Written inRustC++C and LuaC and LuaC++C
Sources

See the Xmake site, Premake, GN, and Muon. The Wefti and CMake columns come from the build tool comparison. The peer benchmark includes Xmake, Premake5, and Muon. GN was unavailable on the test machine.

What one program means for Wefti

The Wefti binary selects its mode from the name you use to run it. The names cmake, ctest, cpack, and ccmake use CMake 4.5.1 compatibility mode. Use wefti build to run Ninja rules with the built-in executor. See the native workflow tools.

The standalone v0.4.0 binary on macOS arm64 is 17.50 MiB (18,352,560 bytes). It contains the CMake 4.5.1 data and unpacks it on first use if the install has no data directory. In the peer benchmark, Wefti used 25.74 MiB of disk space when installed. The CMake package used 250.62 MiB.

A lighter tool can still be the right pick. Premake5 and GN have a small setup for a closed project. Xmake has its own package repository. None of them reads CMakeLists.txt, so a move from CMake means writing new build files and finding new answers for your packages and tests.

Which small CMake alternative should I pick?

Wefti
Keep your CMake files and packages, and get a faster configure plus ctest, cpack, a linter, a formatter, and a language server.
Xmake
A new project with Lua build files and a built-in package repository.
Premake5
A project that needs generated Visual Studio or Xcode files from a Lua script.
GN
A large Ninja-based repository where you write the toolchain rules yourself.
Muon
A Meson project where you want to avoid a Python dependency.
CMake
You need cmake-gui, an omitted legacy generator, or behavior outside the tested Wefti scope.

Frequently asked questions

What is the best lightweight C++ build system?

It depends on your files. If you have CMakeLists.txt, Wefti is the lightest move because nothing is rewritten. For a new project, Xmake, Premake5, GN, and Muon each fit a different style.

What is a small alternative to CMake?

Wefti is a Rust program that reads your CMake files, so it replaces CMake without a rewrite. Xmake and Muon are small tools that need their own build files.

Is Xmake better than CMake?

Xmake uses Lua scripts and has its own package repository. It is a good fit for a new project that wants those. It does not read CMakeLists.txt and does not replace ctest or cpack.

How does Premake compare with CMake?

Premake5 writes IDE projects and Makefiles from Lua scripts. It leaves package management to you. CMake and Wefti also run tests with ctest and build packages with cpack.

How does GN compare with CMake?

GN writes Ninja files for large repositories such as Chromium. You write the toolchain rules, and GN has no package integration. CMake and Wefti have vcpkg and Conan support.

Is Wefti faster than Xmake, Premake, GN, or Muon?

With 500 generated targets, the warm and leaf-edit medians were 789.3 ms and 219.6 ms for Wefti, 3,484.0 ms and 3,483.9 ms for Xmake, 1,049.8 ms and 952.3 ms for Premake5, and 417.0 ms and 210.8 ms for Muon. GN was unavailable on the test machine.