ALPHA
Kiln · Apache 2.0

Kiln - A CMake-compatible build system without stale cache

Kiln takes your existing CMakeLists.txt runs it and builds the project. No more stale cache, modern semantics, faster configuration.

01An actual build system

Configuration, dependency resolution, and execution in one go. New files in a globbed directory get picked up because the configuration is the build.

02CMake compatiblity

Reads your existing CMakeLists.txt and runs CMake’s own Find*.cmake modules. Your projects keeps on working as-is.

03Cross-project parallelism

External projects (FetchContent, ExternalProject, CPM) get configured in-process and merged into the parent graph. Parallel builds across project boundaries. With proactive missing dependency tracking. No more magic missing object files.

04Built-in debugger

Step through CMake from a GDB-style prompt. kiln_dump_target_info prints fully-resolved properties for any target. Tools that save hours running around with educated guesses.

Catch Bugs Early

Because debugging is harder than writing code.

warning: Unbalanced generator expression (missing closing '>')
  --> /home/me/mariadb-server/cmake/install_macros.cmake:291:7
       |
   291 |       $<$<BOOL:${VCPKG_INSTALLED_DIR}>:${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin
       |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: Accepting as-is - CMake treats generator expressions as strings at parse time.
        

Kiln treats your build system as a real program. With errors reporting exact cause and location. Ledgable, helpful and actionable.

# CMake
CMake Error at cmake/modules.cmake:11 (_validate_dependency):
  Unknown CMake command "_validate_dependency".
Call Stack (most recent call first):
  cmake/modules.cmake:6 (_link_module_dependencies)
  CMakeLists.txt:6 (add_module)
# Kiln
error: Unknown command: _validate_dependency
  --> /home/me/Documents/some_project/cmake/modules.cmake:11:9
      |
   11 |         _validate_dependency(${dep})
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Call Stack (most recent call first):
  /home/me/some_project/cmake/modules.cmake:10 (foreach)
  /home/me/some_project/cmake/modules.cmake:6 (_link_module_dependencies)
  /home/me/some_project/CMakeLists.txt:6 (add_module)
Error: Interpretation error

And it even watches for side effects.

warning: custom_command rule for 'tvision-test-passed' exited 0 but did not create its declared OUTPUT
         declared OUTPUT: /home/me/tvision/build/debug/test/tvision-test-passed
         working dir:     /home/me/tvision/build/debug
         downstream rules depending on this OUTPUT may fail, and this
         rule will re-run on every build since its OUTPUT never appears.
         commands run:
           $ /home/me/tvision/build/debug/test/tvision-test
           $ kiln -E touch tvision-test-passed

Performance

Because time-to-beginning-of-build is also very important.

Interpreter Performance

Benchmark CMake Kiln Speedup
8 queens 0.649s 0.058s 11.1x
Knight's tour (N=35) 0.446s 0.047s 8.4x
Smith Waterman (len=70) 3.629s 0.181s 20.04x
Levenshtein Distance (len=70) 3.56s 0.177s 20.1x
cmake-raytracer (256x256, 32T) 8.68s 1.21s 7.17x

Configuration Performance

Project CMake Kiln Speedup
Cold LLVM configuration 8.2s 4.17s 2.01x
Warm LLVM reconfig1 2.2s 0.55s 4.0x
Cold CMake configuration2 21.6s 11.7s 1.84x
Warm CMake reconfig1 2 0.6s 0.28s 2.14x

Real world build performance3

Project CMake + Ninja CMake + Make Kiln
aifoundry-org/et-platform - 73.85s 57.41s
mariadb-server 160.52s 168.60s 156.21s

Measured on Linux with CMake 4.3.2 and Kiln 0.1.0.
1 Apples-to-oranges: CMake’s warm path is backed by CMakeCache.txt, which memoizes find_package results and caches variables. Kiln caches lower - file lookups by mtime, glob with agressive invalidation, etc.. - so it bypasses CMake modules’ built-in short-circuit paths and re-runs more work.
2 The CMake project itself. Does not include CMake generating build files (configuration only).
3 Build performance compared with release builds. Methodology is as expected: point each tool at the target repository, configure, build and sum the wall-clock time. Build time is dominated by compilation with difference down to build system overhead and efficiency.

Try it.

Build from source, then point Kiln at any directory containing a CMakeLists.txt.

# Build Kiln
$ git clone https://github.com/marty1885/kiln
$ cd kiln
$ cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
$ cmake --build build

# Run it on a project
$ build/kiln -C . --config release
   Compiling  [kiln] CMakeArray.cpp
   Compiling  [kiln] ast_cache.cpp
   Compiling  [kiln] autogen.cpp
   ...
    Finished    build in 12.42s (critical path: 8.7s)

What works, what doesn’t, yet.

Kiln is early software. Most projects you point it at on Linux compile and link correctly. Plenty of things needs more work.

Working today

  • GCC/Clang on Linux, C, C++ and ASM
  • Linker selection
  • Incremental builds, dependency tracking, install-to-prefix
  • FetchContent, ExternalProject, CPM
  • AUTOMOC / UIC / RCC
  • Interactive debugger and Chrome-trace profiler
  • Builds tested against LLVM, Qt6Core, TBB, Folly, POCO, DuckDB, MariaDB, drogon, libzmq, Vorbis, Opus, jsoncpp, and CMake itself. With CMake 4.3.2's modules.

In progress / planned

  • Full CMake property set support
  • Windows / MSVC support
  • FreeBSD support
  • macOS support
  • Cross-compilation
  • CUDA, HIP, Objective-C, Fortran, ISPC, Java support
  • CPack. Not supported. install to a prefix works; producing .deb, .rpm, .dmg, .msi, etc. does not.
  • Unity builds
  • C++ module support
  • CMake compatibility. Always a moving target. Real projects builds; corner cases of the language and rare modules will hit edges. Please file issues.