cmake: reducing unnecessary rebuilds
David Faure
faure at kde.org
Tue Mar 21 19:45:48 CET 2006
On Thursday 23 February 2006 15:57, Brad King wrote:
> 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"
make VERBOSE=1 doesn't show such information for me (even after unaliasing "make", i.e. using /usr/bin/make)
-laptop- dfaure 19:42 /devel/kde/build/4/kdelibs4_cmake>/usr/bin/make VERBOSE=1
/devel/other/inst/bin/cmake -H/devel/kde/src/4/kdelibs -B/devel/kde/build/4/kdelibs4_cmake --check-build-system CMakeFiles/Makefile.cmake 0
[...]
-- Configuring done
-- Generating done
-- Build files have been written to: /devel/kde/build/4/kdelibs4_cmake
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/devel/kde/build/4/kdelibs4_cmake'
/usr/bin/make -f dcop/CMakeFiles/DCOP.dir/build.make dcop/CMakeFiles/DCOP.dir/depend
[...]
make[2]: Entering directory `/devel/kde/build/4/kdelibs4_cmake'
Building CXX object kdecore/CMakeFiles/kdecore.dir/kapplication.o
...
Even things like
Scanning dependencies of target kio
/devel/other/inst/bin/cmake -E cmake_depends "Unix Makefiles" /devel/kde/build/4/kdelibs4_cmake /devel/kde/build/4/kdelibs4_cmake/kio /devel/kde/build/4/kdelibs4_cmake/kio/CMakeFiles/kio.dir/DependInfo.cmake
don't show dependee/depender info.
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the Kde-buildsystem
mailing list