Short answer: write a ninja configuration generator instead.
... Where other build systems are high-level languages, Ninja aims to be an assembler.
... Ninja is intended to be used with a separate program generating its input files.
... Ninja is pretty easy to implement for the fun 20% of it and the remaining 80% is "just" some fiddly details.
There are many ninja generators out there already [1] but writing a simple, custom one shouldn't be too hard [2] and could make sense for some projects.
BTW, ninja is great but I wish the configuration file had used a more standard format, easier to parse and generate from any language. JSON would have been a better option I think, given the abundance of tooling around it.
Comments
Short answer: write a ninja configuration generator instead.
There are many ninja generators out there already [1] but writing a simple, custom one shouldn't be too hard [2] and could make sense for some projects.
BTW, ninja is great but I wish the configuration file had used a more standard format, easier to parse and generate from any language. JSON would have been a better option I think, given the abundance of tooling around it.
--
1: https://github.com/ninja-build/ninja/wiki/List-of-generators...
2: https://ninja-build.org/manual.html#ref_ninja_file