[CMake] Ninja fails, Make succeeds...

Mikael Lyngvig mikael at lyngvig.org
Tue Jun 26 16:45:52 EDT 2012


Hi,

I am a fan of Ninja.  Since I started using it, everything's been built
much, much faster than before.  Among other things because I use CMake to
publish headers to the binary directory so as to allow me to include the
headers with a relative path without having to move all my headers to a
central include directory (I want my source files and headers to be in the
same directory).  Ninja does this very fast, whereas GNU Make takes forever
to publish my header files.

However, I have a puzzling problem: Out of the blue, Ninja started failing
to build my project.  If I remake the project with 'cmake -G "MinGW
Makefiles"', it takes ages to build but it succeeds.  If I do 'cmake -G
Ninja', it quickly aborts because it seems that either CMake or Ninja wants
to build one of the last targets at a very early point in the build phase.
 I have an executable, driver.exe, which is supposed to be built as the
very last item.  With Ninja, however, it pops up around 20 percent into the
build and the build fails because the dependent libraries are nowhere to be
found (they haven't been built yet).  I have tried clearing the binaries
directory (rd /s /q foo & md foo) and so on a number of times, but Ninja
insists on trying to build this final executable at a very early stage.

Any ideas?  I suppose the problem is caused by one of these three things:

   1. An error on my part.  Very likely.
   2. An error in CMake's generation of Ninja scripts.  Not unlikely due to
the still fairly immature support for Ninja.
   3. An error in Ninja.  Highly unlikely as Ninja builds tons and tons of
projects all over the world each day and nobody seem to have run into this
problem before.

How do you locate the problem?

Thanks in advance!


Cheers,
Mikael
-- Love Thy Frog!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120626/1ec42155/attachment.htm>


More information about the CMake mailing list