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 &quot;Driver/CMakeFiles/Driver.dir/Driver.cpp.obj.d&quot; -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&#39;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">&lt;<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>&gt;</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 &lt;<a href="mailto:mikael@lyngvig.org">mikael@lyngvig.org</a>&gt; wrote:<br>

&gt; No, I delete the entire build tree (I build out of the source tree, btw).<br>
&gt;<br>
&gt; The procedure is as follows:<br>
&gt;<br>
&gt;    rem foo contains the source code<br>
&gt;    md foo-build<br>
&gt;    cd foo-build<br>
&gt;    cmake -G Ninja ..\foo<br>
&gt;    ninja<br>
&gt;    rem fails as described earlier<br>
<br>
<br>
</div>But you didn&#39;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>
&gt;<br>
&gt;     cd ..<br>
&gt;     rd /s /q foo-build<br>
&gt;     md foo-build<br>
&gt;     cd foo-build<br>
&gt;     cmake -G &quot;MinGW Makefiles&quot; ..\foo<br>
&gt;     make<br>
&gt;     rem succeeds as described earlier<br>
&gt;<br>
&gt; Thank you for your reply.  If you need source, I can send you a zip archive<br>
&gt; as it is an incomplete open source project.<br>
&gt;<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Mikael<br>
&gt;<br>
&gt;<br>
&gt; 2012/6/27 David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; You can&#39;t switch generators in the same build tree without deleting<br>
&gt;&gt; absolutely everything and starting over.<br>
&gt;&gt;<br>
&gt;&gt; Is that what you&#39;re trying to do?<br>
&gt;&gt;<br>
&gt;&gt; If you want a make build tree and a ninja build tree, you&#39;ll need two<br>
&gt;&gt; separate build trees....<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; HTH,<br>
&gt;&gt; David<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Jun 26, 2012 at 4:45 PM, Mikael Lyngvig &lt;<a href="mailto:mikael@lyngvig.org">mikael@lyngvig.org</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Hi,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I am a fan of Ninja.  Since I started using it, everything&#39;s been built<br>
&gt;&gt; &gt; much, much faster than before.  Among other things because I use CMake<br>
&gt;&gt; &gt; to<br>
&gt;&gt; &gt; publish headers to the binary directory so as to allow me to include the<br>
&gt;&gt; &gt; headers with a relative path without having to move all my headers to a<br>
&gt;&gt; &gt; central include directory (I want my source files and headers to be in<br>
&gt;&gt; &gt; the<br>
&gt;&gt; &gt; same directory).  Ninja does this very fast, whereas GNU Make takes<br>
&gt;&gt; &gt; forever<br>
&gt;&gt; &gt; to publish my header files.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; However, I have a puzzling problem: Out of the blue, Ninja started<br>
&gt;&gt; &gt; failing<br>
&gt;&gt; &gt; to build my project.  If I remake the project with &#39;cmake -G &quot;MinGW<br>
&gt;&gt; &gt; Makefiles&quot;&#39;, it takes ages to build but it succeeds.  If I do &#39;cmake -G<br>
&gt;&gt; &gt; Ninja&#39;, it quickly aborts because it seems that either CMake or Ninja<br>
&gt;&gt; &gt; wants<br>
&gt;&gt; &gt; to build one of the last targets at a very early point in the build<br>
&gt;&gt; &gt; phase.<br>
&gt;&gt; &gt;  I have an executable, driver.exe, which is supposed to be built as the<br>
&gt;&gt; &gt; very<br>
&gt;&gt; &gt; last item.  With Ninja, however, it pops up around 20 percent into the<br>
&gt;&gt; &gt; build<br>
&gt;&gt; &gt; and the build fails because the dependent libraries are nowhere to be<br>
&gt;&gt; &gt; found<br>
&gt;&gt; &gt; (they haven&#39;t been built yet).  I have tried clearing the binaries<br>
&gt;&gt; &gt; directory<br>
&gt;&gt; &gt; (rd /s /q foo &amp; md foo) and so on a number of times, but Ninja insists<br>
&gt;&gt; &gt; on<br>
&gt;&gt; &gt; trying to build this final executable at a very early stage.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Any ideas?  I suppose the problem is caused by one of these three<br>
&gt;&gt; &gt; things:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;    1. An error on my part.  Very likely.<br>
&gt;&gt; &gt;    2. An error in CMake&#39;s generation of Ninja scripts.  Not unlikely due<br>
&gt;&gt; &gt; to<br>
&gt;&gt; &gt; the still fairly immature support for Ninja.<br>
&gt;&gt; &gt;    3. An error in Ninja.  Highly unlikely as Ninja builds tons and tons<br>
&gt;&gt; &gt; of<br>
&gt;&gt; &gt; projects all over the world each day and nobody seem to have run into<br>
&gt;&gt; &gt; this<br>
&gt;&gt; &gt; problem before.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; How do you locate the problem?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks in advance!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Cheers,<br>
&gt;&gt; &gt; Mikael<br>
&gt;&gt; &gt; -- Love Thy Frog!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt;&gt; &gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>
</div>