Developing with ENABLE_FINAL build speed
syntheticpp at gmx.net
Tue Mar 27 07:45:10 CEST 2007
When working on KDE one mostly does not work
on all projects and files at the same time,
which means these files will not be touched,
and they could be build with the
The problem using KDE4_ENABLE_FINAL is that
the projects with the touched files have to
rebuild completely on each change.
(With KDE4_ENABLE_FINAL a file is generated
which includes all cpp files.)
The idea of attached patch is to manually
exclude some files from the generated
So it is possible to a build with a speedup
of factor 3 to 4 and to work on some files
without waiting ages on each change, best
of both worlds.
How it works:
the new macro KDE4_CREATE_MERGED_FILES creates
two files, one file which contains all untouched
files and one all touched. By default the file
with the touched files is 'empty', no code is
included (like using KDE4_ENABLE_FINAL).
Moving one file from the const to the touched file
works by commenting out a macro definition and a
include (because the dependency scan of cmake is
macro insensible, or I'm wrong?).
For instance, kgzipfilter.cpp is a untouched file and
kfilterbase.cpp is a touched file:
#if defined(kgzipfilter___ASSUME_CONST) && !defined(DONT_INCLUDE_CONST_FILES)
#if defined(kfilterbase___ASSUME_CONST) && !defined(DONT_INCLUDE_CONST_FILES)
// touched files
// look for non-const files
What about adding this after some polishing?
Could be tested with the option -Dmerge_files=1.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Kde-buildsystem