wefti

Drop-in CMake 4.5.1 in safe Rust.

One binary runs as cmake, ccmake, ctest, cpack, and wefti-lsp.

$ curl -fsSL https://raw.githubusercontent.com/wefti/wefti/main/scripts/install.sh | bash
cmake 4.5.1
$ cmake -S . -B build-2 -G Ninja
  1. -- The CXX compiler identification is AppleClang
  2. -- Detecting CXX compiler ABI info - done
  3. -- Configuring done
  4. -- Generating done
  5. -- Build files have been written to: <project>/build-2
cmake 4.5.11.00×
wefti
$ wefti -S . -B build-2 -G Ninja
  1. -- The CXX compiler identification is AppleClang
  2. -- Detecting CXX compiler ABI info - done
  3. -- Configuring done
  4. -- Generating done
  5. -- Build files have been written to: <project>/build-2
wefti7.16× faster

Synthetic configure on a fresh build tree. wefti uses a warm probe cache.

Checked against CMake 4.5.1

Tests/RunCMake

27,953 / 27,953 cases (100.00%) across 1,099 suites on macOS, Linux, and Windows.

macOSarm64100% · 371/371pass
Linuxx86_64100% · 362/362pass
Windowsx86_64100% · 366/366pass
14,000,000
Seeded fuzz inputs
pass0 panics
6 / 6
WASI smoke
pass
62 / 62
Core conformance
passat 100%
44 / 80
Sealed holdout
failL1 strict parity

All 10 / 10 large C++ projects passed configure and Ninja dry-run parity. All 1,520 / 1,520 scored vcpkg ports matched CMake configure.

Speed

40 / 40 benchmarks faster with speedups of 1.03x to 13.15x against CMake 4.5.1.

Across DuckDB, OpenCV, Protobuf, Qt Base, and LLVM, the geometric means were 1.25x cold, 1.72x with a warm probe cache, and 1.50x after a leaf edit.

See all benchmark results

wefti and CMake 4.5.1

Feature wefti CMake 4.5.1
cmake, ctest, and cpack commands yes yes
cmake -P scripts and cmake -E tools yes yes
Presets schema v13 and File API codemodel v2.12 yes yes
Policies CMP0066-CMP0226 with CMP0000-CMP0065 always NEW yes yes
--sarif-output diagnostics yes yes
CPack archives, DEB, RPM, Bundle, DragNDrop, productbuild, NSIS, NSIS64, WIX, and IFW yes yes
Ninja, Ninja Multi-Config, Unix Makefiles, NMake Makefiles, Xcode, and Visual Studio 2022 and 2026 generators yes yes
ccmake TUI and --debugger DAP server yes yes
Written in Safe Rust with zstd and liblzma C codecs C++
Archive owner in cmake -E tar and CPack uid 0, gid 0 host owner
CUDA, HIP, and Swift targets differslowering shipped, CI lacks GPU and Swift runners yes
Probe cache and portable CI archives shared across projects plus cache export and import per build tree
Incremental configure replay replays unchanged subtrees including toolchains and presets full reconfigure
Provenance, find diagnosis, and genex eval wefti explain (--flag, --dep, --find, --eval) --trace-format=json-v1, File API backtraces
Build comparison and parity verification wefti diff-config and isolated wefti verify not available
Lossless formatter and 8-rule static linter wefti fmt, wefti lint, .wefti.toml, and LSP not available
Multi-config compile_commands.json and drift detection --export-compile-commands and wefti doctor -B not available
--hermetic input audit and --fetch-lock yes not available
Built-in language server (wefti-lsp) and WebAssembly yes not available
cmake-gui not available yes
CodeBlocks, CodeLite, Eclipse CDT4, Kate, and Sublime Text 2 generators not available yes
MinGW Makefiles and MSYS Makefiles not available yes
Visual Studio 2015 to 2019 generators not available yes

Inside a configure run

Eval

Runs commands and tracks variables, policies, and generator expressions.

wefti-evalwefti-commandswefti-exprwefti-genexwefti-modelwefti-presets
  1. Syntax lexes and parses CMake language files.
  2. Eval runs commands and tracks variables, policies, and generator expressions.
  3. Resolve builds the target graph, usage requirements, and link order.
  4. Generate writes build.ninja, Unix Makefiles, NMake Makefiles, project.pbxproj, and .vcxproj files.
  5. Host abstracts OS access. NativeHost reads disk, environment, processes, and clock, while PureHost keeps files in memory for tests, editors, and wasm32.

Generators and languages

Generators

  • Ninjabuild.ninjamacOSLinuxWindows
  • Ninja Multi-Configbuild.ninja build-<Config>.ninjamacOSLinuxWindows
  • Unix MakefilesMakefilemacOSLinux
  • NMake MakefilesMakefileWindows
  • Xcodeproject.pbxprojmacOS
  • Visual Studio 17 2022 and 18 2026.sln .slnx .vcxprojWindows

Languages

  • C
  • C++ with modules
  • Objective-C
  • Objective-C++
  • Fortran
  • CUDA
  • HIP
  • Swift
  • ASM, MASM, NASM
  • RC
  • Qt

Common questions

Is wefti a drop-in replacement for CMake 4.5.1?

Yes. A single wefti binary inspects argv[0] to run as cmake, ccmake on macOS, Linux, and Windows, ctest, cpack, or wefti-lsp. It reads existing CMakeLists.txt files, Presets v13, and CMakeCache.txt, then writes compatible build trees. Starting it as cmake, ccmake, ctest, or cpack, or setting WEFTI_ORACLE_MODE=1, selects compatibility mode matching CMake 4.5.1.

Which generators, languages, and package managers does wefti support?

wefti generates Ninja, Ninja Multi-Config, Unix Makefiles, NMake Makefiles on Windows, Xcode on macOS, and Visual Studio 17 2022 and Visual Studio 18 2026 on Windows. It supports C, C++ with C++20 and C++23 named modules, Objective-C, Objective-C++, Fortran, CUDA, HIP, Swift, ASM, MASM, NASM, Windows RC, and Qt AUTOGEN. CPack covers archives, DEB, RPM, External, Bundle, DragNDrop, productbuild, NSIS, NSIS64, WIX v3 and v4, and IFW, alongside vcpkg, Conan, and FetchContent.

How do the probe cache, incremental replay, and drift checks work?

In native mode, wefti caches verified compiler probes across projects after checking SHA-256 input digests, runs up to four literal compile probes in parallel, and shares caches across CI runners via wefti cache export and import. Incremental replay reuses unchanged directory subtrees even with vcpkg toolchains, configure presets, -C scripts, and PreLoad.cmake by validating setup checkpoints. Native configures and wefti doctor -B also detect stale CMakeCache.txt drift when compilers or toolchains change.

What native developer tools come with wefti 0.2.2?

Opt-in native tools include wefti explain for flags, definitions, includes, dependency paths, find_package rejections, and generator expressions, wefti diff-config to compare any two cmake or wefti build directories, wefti fmt and 8-rule wefti lint configured by .wefti.toml, wefti verify for side-by-side CMake 4.5.1 checks in an isolated companion binary, multi-config compile_commands.json export, --profile flame graphs, --hermetic audits, and --fetch-lock. Use wefti explain --targets to list targets and wefti preset show to inspect a resolved preset. Native configure can suggest a correction for an unused -D variable.

How do I install wefti and alias cmake, ctest, cpack, and ccmake?

On Linux and macOS, run curl -fsSL https://raw.githubusercontent.com/wefti/wefti/main/scripts/install.sh | bash to install wefti, wefti-lsp, wefti-verify, shell completions, and man pages into ~/.local. Append -s -- --alias-cmake after bash to symlink cmake, ctest, cpack, and ccmake. On Windows, run scripts/install.ps1 with -AliasCmake for aliases, or extract the x86_64-pc-windows-msvc ZIP archive from GitHub Releases. The release workflow builds Homebrew, Scoop, and WinGet manifests from the release checksums. Intel Macs build from source with scripts/install.sh --from-source.

What is intentionally different or not implemented in wefti?

cmake-gui is not included. CPack installer generators invoke native host packagers, and wefti verify requires a user-supplied CMake 4.5.1 binary. Legacy extra generators, older Makefile variants, and Visual Studio 14 to 16 are omitted. Tar and CPack archives record uid 0 and gid 0, and try_compile runs in-process.

Does wefti contain any unsafe Rust or copied CMake C++ code?

wefti contains no copied or translated CMake C++ code. The only project file with unsafe Rust is the audited Windows process interface in wefti-winproc/src/ffi.rs. External Rust crates such as rustix and memchr use unsafe internally, and the native binary statically links zstd 1.5.7 and liblzma 5.8. Bundled CMake 4.5.1 Modules/, Templates/, and Help/ files stay under BSD-3-Clause, while Rust and Python code in this repository uses MIT OR Apache-2.0.

Can I run wefti in WebAssembly or use an editor language server?

Yes. All OS access goes through wefti_host::Host, so wefti-api compiles with --no-default-features to wasm32-unknown-unknown and wasm32-wasip1 on PureHost, powering the zero-server browser playground. For editors, wefti-lsp (or wefti lsp) runs over stdio and provides hover with evaluated values, completion, go to definition, symbols, semantic tokens, quick fixes, lossless formatting, and all 8 static lint rules in VS Code, Neovim, Helix, Zed, Emacs, and CLion.

How much faster is wefti than CMake 4.5.1?

In v0.2.2, wefti ran faster in all 40 measured workloads, with speedups of 1.03x to 13.15x. Across five large C++ projects, the geometric mean speedups were 1.25x cold, 1.72x with a warm probe cache, and 1.50x after a leaf edit. See the benchmark tables for exact timings and test conditions.

How does wefti compare to Meson and Bazel?

wefti reads your existing CMakeLists.txt files. Meson and Bazel use their own build definitions. Ninja runs the build rules that wefti generates. See the comparison guide for details.