1

Using cmake 3.7.2 I recently switched a project from Unix Makefile to Cmake with Unix makefile generator.

All works as expected and the main problems we wanted to solve are solved (command line length in windows).

I discovered a great thing that is dependency checking as there is no more need to clean in normal situations and rebuild unneeded files.

Now the dependency is very slow (about 70s) when the all build is only 20s. Is there a way to speed up the checking ? Or to find the bottleneck of this check ?

Julien
  • 1,810
  • 1
  • 16
  • 34
  • That's one reason why I use [`ninja`](https://ninja-build.org/) as a `make` replacement in my projects. Newer versions of `ninja` even use an internal database to significantly speed-up the dependency checking (it doen't have to open each dependency file individually, especially useful if your file I/O is slow). See also [here](https://stackoverflow.com/questions/37327526/how-to-speed-up-compile-time-of-my-cmake-enabled-c-project). – Florian Apr 18 '17 at 19:32

1 Answers1

0

GNU make dependency check IS slow. Ninja was designed to be much faster ans IS definitely faster. The update to Ninja is very simple as only cmake generator (-G) has to be modified.

Julien
  • 1,810
  • 1
  • 16
  • 34