
#CMAKE VS MAKE FULL#
It has less overhead when performing incremental builds but for full builds any performance gains would be negligible. Any standard UNIX-style make program can build the project through the default make target. Ninja and Make are very close in terms of performance. Performance for increasing threads, all times are in seconds Chrono ThreadsĬompiling an already compiled project, compiling after touching a single file. for i in do ninja clean & time ninja -j $i > /dev/null 2>&1 done Results: Make und CMake sind Build-Management-Tools, die zur Automatisierung von Software-Erstellung verwendet werden. In practice > /dev/null 2>&1 should not be used.

cmake very much wasn't: it comes from a world where that isn't a thing, and it shows. Redirecting to dev null was performed so that only the timing output would be written to standard out. A lot of the hate for cmake comes from people who are used to build systems from the open source world that are designed so that users (i.e., not established developers of the project itself) can configure and build things. Timing was performed using the linux “time” command and all builds were done in memory and all output was redirected to /dev/null.
#CMAKE VS MAKE GENERATOR#
To generate files for Ninja use the -G flag in cmake to specify the generator type. The host OS is Arch Linux and the compiler used is GCC 4.9.2. I wanted to measure the performance of Make and Ninja for several projects, namely chrono and ogre.Ĭompilation will be performed on an Intel Haswell i7-4770K CPU with 32GB of ram. So beyond the performance improvements Ninja has a higher signal to noise ratio than Make. Make on the other hand will output a line for every single cpp file that was compiled and linked. Warnings and Errors are output like normal.

Ninja does not output information about the current progress of the build on more than one line. To quote the chromium project “Ninja is a build system written with the specific goal of improving the edit-compile cycle time”. Here is an example: assume your source code is in a directory called src and you are one directory up from there. To use Xcode, you will obviously have to have Xcode installed. It was designed for fast incremental builds and large projects in general. Xcode build performs parallel builds by default.

Ninja, written by Evan Martin is a build system that is focused on performance. There are cases where the flexibility and power of make are overkill in terms of compiling code and if you are willing to trade them with improved performance Ninja might be what you are looking for. Make and its derivatives been around for almost 40 years and it’s an extremely powerful tool that can do many things beyond simply compiling code. Most linux distributions come with the make command so getting up and running doesn’t require too much effort. Ever since I started using CMake to handle generating my build files I have relied on Makefiles.
