4 ms·
CMake-generated ninja builds aren't fast in an oranges-to-oranges comparison: http://www.kaizou.org/2016/09/build-benchmark-large-c-project.html (TL;DR: scr
by wahern 10y ago
CMake-generated ninja builds aren't fast in an oranges-to-oranges comparison:
http://www.kaizou.org/2016/09/build-benchmark-large-c-project.html
(TL;DR: scroll to bottom of page to see "The raw results".)
A non-recursive Make build is actually pretty darn peppy for all but the largest projects. The reason ninja was faster at scale in those tests was likely because GNU Make has some very inefficient code internally which theoretically could be improved substantially with some refactoring. ninja had the benefit of a fresh implementation, avoiding decades of feature creep.
I've been writing non-recursive-style Makefiles for years. But all I ever hear is whining by project contributors about the unfamiliar syntax (e.g. having to prefix all targets and sources with a path). Yet in the same breath I'll be told to use CMake or ninja or tup or whatever the build-system-du-jour, using vastly different syntax. Ah well....
I keep dreaming of a Makefile generator that will auto-generate a non-recursive build, or perhaps add the feature into GNU Make directly. The problem with the latter approach is that one major reason to use Make (including GNU Make) is portability out-of-the-box, but OS X is stuck at GNU Make 3.81.
- sriram_sun 10y agoThanks for the info. I just looked into it. You are right about non-recursive Makefiles. My own experience with cmake generated makefiles are actually comparable with ninja build times. Why would you want to write Makefiles by hand anyway? With CMake you can generate VS 2015 or MinGW or ninja pretty much any project file. QtCreator deals with CMake project really well. KDevelop too. I think CMake is the way to go. Then we won't be talking about ninja vs. make vs. tup