cmake: reducing unnecessary rebuilds
Brad King
brad.king at kitware.com
Thu Feb 23 15:30:59 CET 2006
David Faure wrote:
> cmake seems to like to rebuild every single object file in kdelibs after I svn update.
> I'm trying to find out why.
Can you post two revision numbers such that after building with the
first I can update and see this behavior?
> One thing I noticed is that DependInfo.cmake seems to be updated just to
> change the order of lines in it. I guess this is because it comes out of a hashtable?
> It would need to be sorted, to avoid unnecessary changes (which trigger rebuilding,
> or at least unnecessary calls to cmake_depends, right?)
When a header or source file changes dependencies might have changed so
CMake rescans them. This updates the DependInfo.cmake file, and may
write things in a new order. The order of dependencies listed in the
file should not matter.
> Also, somehow something deletes many .o files during the build process so I can't
> see exactly why so many files have to be rebuilt, make -d simply says "kdebug.o
> doesn't exist anymore, so obviously I need to rebuild it". But why does it get deleted?
When it is detected that an object file is out of date during dependency
scanning it gets deleted to be sure it is rebuilt. I've forgotten the
exact reason we have to do this. I think we had some problems with low
resolution time on make's decision making with some older makes that
prevent things from rebuilding unless the object is missing altogether.
-Brad
More information about the Kde-buildsystem
mailing list