Ohh, sorry. Ninja says:<div><br></div><div><div>[117/325] Building CXX object Driver/CMakeFiles/Driver.dir/Driver.cpp.obj</div><div>FAILED: c:\Mingw64\bin\c++.exe -DNDEBUG -DBR0_BUILD_ASSERT=BR0_BUILD_ASSERT_DELETE -DBR0_BUILD_CHARSET=BR0_BUILD_CHARSET_ASCII -DBR0_BUILD_ENDIAN=BR0_BUILD_ENDIAN_LITTLE -DBR0_BUILD_MODE=BR0_BUILD_MODE_SHIP -DBR0_BUILD_TARGET=BR0_BUILD_TARGET_WINDOWS -Wall -Wno-long-long -pedantic -I.. -Ic:/Synology/clang-3.2-WIN64/include -static-libgcc -MMD -MT Driver/CMakeFiles/Driver.dir/Driver.cpp.obj -MF "Driver/CMakeFiles/Driver.dir/Driver.cpp.obj.d" -o Driver/CMakeFiles/Driver.dir/Driver.cpp.obj -c C:/Dropbox/Source/braceless/src/Driver/Driver.cpp</div>
<div>C:/Dropbox/Source/braceless/src/Driver/Driver.cpp:11:42: fatal error: Braceless0/Backend/Backend.hpp: No such file or directory</div><div>compilation terminated.</div><div>[117/325] Building CXX object Driver/CMakeFiles/Driver.dir/Setup.cpp.obj</div>
<div>ninja: build stopped: subcommand failed.</div><div><br></div><div>The problem is that the file Driver.cpp depends on Backend.hpp having been created. But Driver.cpp should not be compiled until the second-last item in the list of objects to make ([324/325]).</div>
<div><br></div><div>So, somehow, Ninja picks up the target Driver.obj and builds it way too early. With GNU Make, everything goes according to plan, but with Ninja, there's some sort of confusion somewhere.</div><div>
<br></div><div><br></div><div>Cheers,</div><div>Mikael</div><br><div class="gmail_quote">2012/6/27 David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Jun 26, 2012 at 6:30 PM, Mikael Lyngvig <<a href="mailto:mikael@lyngvig.org">mikael@lyngvig.org</a>> wrote:<br>
> No, I delete the entire build tree (I build out of the source tree, btw).<br>
><br>
> The procedure is as follows:<br>
><br>
> rem foo contains the source code<br>
> md foo-build<br>
> cd foo-build<br>
> cmake -G Ninja ..\foo<br>
> ninja<br>
> rem fails as described earlier<br>
<br>
<br>
</div>But you didn't really describe the failure.<br>
<br>
What is the error output? (from cmake or from ninja?)<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> cd ..<br>
> rd /s /q foo-build<br>
> md foo-build<br>
> cd foo-build<br>
> cmake -G "MinGW Makefiles" ..\foo<br>
> make<br>
> rem succeeds as described earlier<br>
><br>
> Thank you for your reply. If you need source, I can send you a zip archive<br>
> as it is an incomplete open source project.<br>
><br>
><br>
> Cheers,<br>
> Mikael<br>
><br>
><br>
> 2012/6/27 David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>><br>
>><br>
>> You can't switch generators in the same build tree without deleting<br>
>> absolutely everything and starting over.<br>
>><br>
>> Is that what you're trying to do?<br>
>><br>
>> If you want a make build tree and a ninja build tree, you'll need two<br>
>> separate build trees....<br>
>><br>
>><br>
>> HTH,<br>
>> David<br>
>><br>
>><br>
>> On Tue, Jun 26, 2012 at 4:45 PM, Mikael Lyngvig <<a href="mailto:mikael@lyngvig.org">mikael@lyngvig.org</a>><br>
>> wrote:<br>
>> > Hi,<br>
>> ><br>
>> > I am a fan of Ninja. Since I started using it, everything's been built<br>
>> > much, much faster than before. Among other things because I use CMake<br>
>> > to<br>
>> > publish headers to the binary directory so as to allow me to include the<br>
>> > headers with a relative path without having to move all my headers to a<br>
>> > central include directory (I want my source files and headers to be in<br>
>> > the<br>
>> > same directory). Ninja does this very fast, whereas GNU Make takes<br>
>> > forever<br>
>> > to publish my header files.<br>
>> ><br>
>> > However, I have a puzzling problem: Out of the blue, Ninja started<br>
>> > failing<br>
>> > to build my project. If I remake the project with 'cmake -G "MinGW<br>
>> > Makefiles"', it takes ages to build but it succeeds. If I do 'cmake -G<br>
>> > Ninja', it quickly aborts because it seems that either CMake or Ninja<br>
>> > wants<br>
>> > to build one of the last targets at a very early point in the build<br>
>> > phase.<br>
>> > I have an executable, driver.exe, which is supposed to be built as the<br>
>> > very<br>
>> > last item. With Ninja, however, it pops up around 20 percent into the<br>
>> > build<br>
>> > and the build fails because the dependent libraries are nowhere to be<br>
>> > found<br>
>> > (they haven't been built yet). I have tried clearing the binaries<br>
>> > directory<br>
>> > (rd /s /q foo & md foo) and so on a number of times, but Ninja insists<br>
>> > on<br>
>> > trying to build this final executable at a very early stage.<br>
>> ><br>
>> > Any ideas? I suppose the problem is caused by one of these three<br>
>> > things:<br>
>> ><br>
>> > 1. An error on my part. Very likely.<br>
>> > 2. An error in CMake's generation of Ninja scripts. Not unlikely due<br>
>> > to<br>
>> > the still fairly immature support for Ninja.<br>
>> > 3. An error in Ninja. Highly unlikely as Ninja builds tons and tons<br>
>> > of<br>
>> > projects all over the world each day and nobody seem to have run into<br>
>> > this<br>
>> > problem before.<br>
>> ><br>
>> > How do you locate the problem?<br>
>> ><br>
>> > Thanks in advance!<br>
>> ><br>
>> ><br>
>> > Cheers,<br>
>> > Mikael<br>
>> > -- Love Thy Frog!<br>
>> ><br>
>> > --<br>
>> ><br>
>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> ><br>
>> > Visit other Kitware open-source projects at<br>
>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> ><br>
>> > Please keep messages on-topic and check the CMake FAQ at:<br>
>> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>> ><br>
>> > Follow this link to subscribe/unsubscribe:<br>
>> > <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
><br>
><br>
</div></div></blockquote></div><br>
</div>