Live data from Hacker News

Ninja – A small build system with a focus on speed

martine.github.io

1–10 of 30 posts

Re: Ninja – A small build system with a focus on speed

#3
post #2

Jeez, can't you kids just quit this square-wheel churn and just buckle down and learn to write makefiles? It's really not that hard.

Sigh. As far as I can tell ninja is primarily used as a cmake backend. Mostly because the people who wrote cmake never learned to write Makefiles and as a result using ninja with cmake is much faster.

Re: Ninja – A small build system with a focus on speed

#4
post #3
post #2

Jeez, can't you kids just quit this square-wheel churn and just buckle down and learn to write makefiles? It's really not that hard.

Sigh. As far as I can tell ninja is primarily used as a cmake backend. Mostly because the people who wrote cmake never learned to write Makefiles and as a result using ninja with cmake is much faster.

Kitware have a lot to apologise for.

Re: Ninja – A small build system with a focus on speed

#5
post #2

Jeez, can't you kids just quit this square-wheel churn and just buckle down and learn to write makefiles? It's really not that hard.

As someone who has used make a lot, screw writing makefiles. It's too low-level and I want to be able to build my stuff without lots of headache on multiple platforms (which includes Windows). I hate CMake's weird language, but even that beats makefiles.

Re: Ninja – A small build system with a focus on speed

#6
post #3
post #2

Jeez, can't you kids just quit this square-wheel churn and just buckle down and learn to write makefiles? It's really not that hard.

Sigh. As far as I can tell ninja is primarily used as a cmake backend. Mostly because the people who wrote cmake never learned to write Makefiles and as a result using ninja with cmake is much faster.

Actually it's more like a "second step" for make. You can use make to generate ninja files, and then ninja does the actual build. The idea is that make makes a lot of decisions that (usually) stay fairly stable as the files change gradually. Obviously CMake and various other build tools can also generate the .ninja files too.

e.g Make/CMake decides whether you're doing a debug or release build, and builds the appropriate ninja files. Ninja then doesn't have any decisions to make, other than purely what to build, which makes it fast.

It's used for Chrome/Chromium, and I believe the "no-op" build time is still under a second. If you then change a .cpp, it will only compile the absolute minimum, and calculation as to what to build is incredibly fast. make is considerably slower on the same set of files (so they say, not tested it personally, but the figures are around somewhere).

Probably only worth it for really big projects.

Re: Ninja – A small build system with a focus on speed

#7
post #2

Jeez, can't you kids just quit this square-wheel churn and just buckle down and learn to write makefiles? It's really not that hard.

A Ninja file is probably no easier to write than a Makefile. But Ninja is a lot faster than make, which is the reason for using it. To see this, configure Chromium to build with Xcode, make, and ninja, and compare the build times.
Post reply on HN