Current version of Samurai is compatible with Ninja 1.9.0. It has fewer dependencies and is a simpler implementation than Ninja. Alpine Linux uses Samurai instead of Ninja (see [0] for the original proposal about this). CMake and Meson have native support for it nowadays. This does the rest and hooks it up to the framework to make it trivial to experiment with it. OpenBSD Ports has a similar USE_NINJA=samurai knob for this but only for cmake-based ports.
[0] https://lists.alpinelinux.org/~alpine/devel/%3CBYZDB5LH4OVY.9FDVF5I3J954%40homura%3E