5 ms·
Ninja is enough build system
- gary_0 3y agoIn the links to Ninja implementations at the bottom: > This tiny little implementation[0] in Python! 345 lines of well-commented Python. Cute as a button! It doesn't seem to re-use already-built files, though. I wonder how many lines that would add. I actually have a bit of Python in my build pipeline that basically just goes `if os.path.getmtime(src) > os.path.getmtime(target)` and it works fine for that one file (and took far less effort than trying to shoehorn that build step into my Makefile). [0] https://github.com/gkbrk/scripts/blob/master/ninja.py https://github.com/gkbrk/scripts/blob/master/ninja.py
- tekknolagi 3y agoOh, that would be a nice addition. Maybe I will vendor this little script some day.
- tekknolagi 3y agoI put it all together here: https://github.com/tekknolagi/ninja-demo https://github.com/tekknolagi/ninja-demo
- hulitu 3y ago> Ninja is enough build system and then: > There are tools like CMake and Meson that can generate Ninja files So ninja is not enough. You need Meson, CMake and finally, make.
- rcxdude 3y agoNo, there's no make anywhere in the article (ninja is a substitute for make with simpler syntax designed to be generated), and it's giving you an example of how you can get rid of CMake and Meson.
- 1letterunixname 3y agoSamurai is a faster, drop-in replacement for ninja. https://github.com/michaelforney/samurai https://github.com/michaelforney/samurai Edit: It someone writes a ninja-compatible tool in Rust, they must call it "ronin."
- jambutters 3y agozig as a build system is even better!
- TheMatten 3y agoAnother interesting implementation is Shake: https://shakebuild.com/ https://shakebuild.com/ It is technically a Haskell DSL, but supports Ninja files, time estimates and has tools for linting and profiling.
- tekknolagi 3y agoHuh, TIL! I will add this to the post. Thanks!
- aappleby 3y agoAbsolutely, I use raw Ninja for all my personal projects. The only support I miss is globs, as the Ninja files are quite redundant without them. In some of those cases I use a few lines of Python to regenerate a list of Ninja targets.