cmake: reducing unnecessary rebuilds

Brad King brad.king at kitware.com
Thu Feb 23 15:57:44 CET 2006


David Faure wrote:
> On Thursday 23 February 2006 15:30, Brad King wrote:
> 
>>David Faure wrote:
>>>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.
> 
> :( but that makes debugging with make -d useless. How else can I find out why
> an object file is detected to be out of date? Does cmake have a flag for debugging
> this, or do I need to add printfs in the code?

With VERBOSE makefiles or by running "make VERBOSE=1" CMake prints 
information about what the dependency scanning is doing.  The output 
looks like

Dependee "/some/header.h" is newer than depender "some/object.o"

-Brad


More information about the Kde-buildsystem mailing list