[CMake] Ninja: It's ninja issue, or CMake problem?

Peter Kümmel syntheticpp at gmx.net
Tue Sep 25 03:04:56 EDT 2012


On 25.09.2012 08:13, Loaden wrote:
> *After change Core_pch.cpp (add #include <iostream> in it), here is the
> build log:*
>
>> [1/2] Building CXX object
>> src\plugins\coreplugin\CMakeFiles\Core.dir\Core_pch.cpp.obj
>> [2/2] Linking CXX shared library lib\qtcreator\plugins\Nokia\Core.dll

Yes, lib.cpp is not compiled again.

> build.ninja

>> =============================================================================
>> # Object build statements for SHARED_LIBRARY target Core
>>
>> build src\plugins\coreplugin\CMakeFiles\Core.dir\lib.cpp.obj: CXX_COMPILER
>> ..\src\plugins\coreplugin\lib.cpp || src\plugins\coreplugin\Core_pch.pch
>>    DEFINES = -DCore_EXPORTS -DUNICODE -D_CRT_SECURE_NO_WARNINGS

OK, Core_pch.pch is listed, but only as "Order-only dependency": 
http://martine.github.com/ninja/manual.html#ref_dependencies

Does it work when you make the pch a "Implicit dependency": change '||' to '|'?

This could be fixed in you pch macro by making each source file depend on the pch file.
Or is this already done? Then you have found a bug in the ninja generator.

Peter



More information about the CMake mailing list