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

Loaden loaden at gmail.com
Tue Sep 25 03:18:48 EDT 2012


2012/9/25 Peter Kümmel <syntheticpp at gmx.net>

> OK, Core_pch.pch is listed, but only as "Order-only dependency":
> http://martine.github.com/**ninja/manual.html#ref_**dependencies<http://martine.github.com/ninja/manual.html#ref_dependencies>
>
> Does it work when you make the pch a "Implicit dependency": change '||' to
> '|'?
>
Yes, Change "||" to "|", it works!


>
> 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.
>
Yes, It is done. NMake Makefiles and Unix Makefiles generator both works.
Here is NMake build logs:

*First build:*

> D:\qpSOFT\Projects\QtCreator\ok>nmake
>
> Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
> Scanning dependencies of target Core
> [ 50%] Building CXX object
> src/plugins/coreplugin/CMakeFiles/Core.dir/Core_pch.cpp.obj
> Core_pch.cpp
> [100%] Building CXX object
> src/plugins/coreplugin/CMakeFiles/Core.dir/lib.cpp.obj
> lib.cpp
> Linking CXX shared library ..\..\..\lib\qtcreator\plugins\Nokia\Core.dll
> [100%] Built target Core
>
>
*No changes, Build again :*

> D:\qpSOFT\Projects\QtCreator\ok>nmake
>
> Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
> [100%] Built target Core
>
>
*Change Core_pch.cpp (Add #include <iostream>):*

> D:\qpSOFT\Projects\QtCreator\ok>nmake
>
> Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
> Scanning dependencies of target Core
> [ 50%] Building CXX object
> src/plugins/coreplugin/CMakeFiles/Core.dir/Core_pch.cpp.obj
> Core_pch.cpp
> [100%] Building CXX object
> src/plugins/coreplugin/CMakeFiles/Core.dir/lib.cpp.obj
> lib.cpp
> Linking CXX shared library ..\..\..\lib\qtcreator\plugins\Nokia\Core.dll
> [100%] Built target Core
>

But I don't know It's a cmake bug? or a ninja bug?

-- 
*Please don't ask where I come from, It's a shame!*
Best Regards
Yuchen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120925/267f0ede/attachment.htm>


More information about the CMake mailing list