MantisBT - CMake
View Issue Details
0013988CMakeCMakepublic2013-03-06 17:592013-10-07 10:03
bamiaux 
Peter Kuemmel 
normalmajoralways
closedfixed 
windowswindows7
CMake 2.8.10.2 
CMake 2.8.11 
0013988: Ninja: generated files like moc, huge deps list (bis)
I believe the bug http://www.cmake.org/Bug/view.php?id=13874 [^] is still present.
Compiling the included project mandelbrot with the nightly build taken at http://www.cmake.org/files/dev/cmake-2.8.10.20130305-gd559be-win32-x86.zip [^]
still have cpp files which depend on every generated moc file.
This is the same behavior I get in my own project. This is not restricted to moc files, actually all generated files get put as dependency to every cpp leading to very huge ninja dependencies.
This bug is supposed to have been fixed by the following commit http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bbea30eec88fe6dc98d716f16141c6aab6a75314 [^]
No tags attached.
related to 0013592closed Peter Kuemmel Ninja: Inefficient Ninja DAG with add_custom_command 
Issue History
2013-03-06 17:59bamiauxNew Issue
2013-03-07 11:46Bill HoffmanAssigned To => Peter Kuemmel
2013-03-07 11:46Bill HoffmanStatusnew => assigned
2013-03-09 03:03Peter KuemmelNote Added: 0032544
2013-03-09 06:11Peter KuemmelRelationship addedrelated to 0013592
2013-03-13 05:28bamiauxNote Added: 0032598
2013-03-13 06:22Peter KuemmelNote Added: 0032599
2013-03-13 06:22Peter KuemmelStatusassigned => resolved
2013-03-13 06:22Peter KuemmelFixed in Version => CMake 2.8.11
2013-03-13 06:22Peter KuemmelResolutionopen => fixed
2013-10-07 10:03Robert MaynardNote Added: 0033994
2013-10-07 10:03Robert MaynardStatusresolved => closed

Notes
(0032544)
Peter Kuemmel   
2013-03-09 03:03   
Thanks for checking again.

I did following steps.

- unziped the cmake binary
- set PATH so "cmake -version" prints "cmake version 2.8.10.20130305-gd559be"
- called in a build dir "cmake -GNinja <source dir>"
- ninja builds 8 files

- opened a generated moc_ file
- touched it
- "ninja -v" builds 2 files: the moc_ and links

This is the correct behavior.

The old and buggy behavior could be reproduced by replacing in build.ninja all "|| moc_" strings with "| moc_",
then ninja builds 6 files when a moc_ is touched. This bug is fixed.

But maybe you found another bug. Could you check again?
(0032598)
bamiaux   
2013-03-13 05:28   
I checked again, and you are right, it doesn't rebuild more files than necessary.
I was confused by the fact that all moc files are still mentionned for every cpp object rule.
Are those rules here to ensure every moc is generated before any cpp is compiled ?
It seems to me that a moc should be made dependent only on its header
(0032599)
Peter Kuemmel   
2013-03-13 06:22   
Yes, principally the cpp files does not depend on the moc files.
(only when you include the moc file in the cpp file). But this configures
FindQt, and I don't know what the reasons where to add such dependency.
(0033994)
Robert Maynard   
2013-10-07 10:03   
Closing resolved issues that have not been updated in more than 4 months.