[CMake] Ninja fails, Make succeeds...
David Cole
david.cole at kitware.com
Tue Jun 26 18:35:41 EDT 2012
On Tue, Jun 26, 2012 at 6:30 PM, Mikael Lyngvig <mikael at lyngvig.org> wrote:
> No, I delete the entire build tree (I build out of the source tree, btw).
>
> The procedure is as follows:
>
> rem foo contains the source code
> md foo-build
> cd foo-build
> cmake -G Ninja ..\foo
> ninja
> rem fails as described earlier
But you didn't really describe the failure.
What is the error output? (from cmake or from ninja?)
>
> cd ..
> rd /s /q foo-build
> md foo-build
> cd foo-build
> cmake -G "MinGW Makefiles" ..\foo
> make
> rem succeeds as described earlier
>
> Thank you for your reply. If you need source, I can send you a zip archive
> as it is an incomplete open source project.
>
>
> Cheers,
> Mikael
>
>
> 2012/6/27 David Cole <david.cole at kitware.com>
>>
>> You can't switch generators in the same build tree without deleting
>> absolutely everything and starting over.
>>
>> Is that what you're trying to do?
>>
>> If you want a make build tree and a ninja build tree, you'll need two
>> separate build trees....
>>
>>
>> HTH,
>> David
>>
>>
>> On Tue, Jun 26, 2012 at 4:45 PM, Mikael Lyngvig <mikael at lyngvig.org>
>> wrote:
>> > 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!
>> >
>> > --
>> >
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the CMake FAQ at:
>> > http://www.cmake.org/Wiki/CMake_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.cmake.org/mailman/listinfo/cmake
>
>
More information about the CMake
mailing list