Build system (was Re: Future of KDE Development)
Hans Meine
hans_meine at gmx.net
Wed Feb 16 20:02:22 GMT 2005
On Wednesday 16 February 2005 20:34, Alexander Neundorf wrote:
> > That's near to the border of FUD IMHO ;)
> >
> > The scons example posted earlier ist already quite complex and most of
> > the stuff putted in there could be done one level higher, so that a
> > simple
> >
> > KApplication( 'foobar', ['main.cpp','mainwindow.cpp','mywidget.cpp'] )
>
> One thing I don't like here is that I have to use python syntax.
>
> With cmake this *could* look like:
>
> KDE_ADD_APP(foobar main.cpp mainwindow.cpp mywidget.cpp)
Quote from http://www.scons.org/doc/HTML/scons-python10/x106.html:
"
[...]
source_files = ['f1.c', 'f2.c', 'f3.c']
[...]
Because quoting individul strings in long lists of files can get tedious and
error-prone, the SCons methods support a short-cut of listing multiple files
in a single string, separated by white space. This would change the
assignment in the above example to a more easily-readable:
source_files = 'f1.c f2.c f3.c'
[...]
"
Needless to say that the same applies to our example:
KApplication('foobar', 'main.cpp mainwindow.cpp mywidget.cpp')
Or even (with a trivial addon for Alex):
KAppLikeCMake('foobar main.cpp mainwindow.cpp mywidget.cpp')
which I personally find quite ugly. ;-)
I love the idea of writing build scripts in Python, and IMHO it's clear that
this immediately opens up the possibility to write extremely simple build
scripts like the ones above without sacrifycing flexibility. Of course one
can extend most build systems to allow for simple app definitions, but who
wants to learn another macro language? (Recall: m4 is an "easy language" too,
but its simplicity indirectly leads to the horror perceived when editing
configure.in's..)
The only disadvantage of SCons compared to autohell seems to be that it needs
Python installed, even for non-maintainers who want to compile KDE. However,
that's far outweighted by not having 2Mb configure files anymore IMHO (and
probably applies to CMake, too).
Disclaimer: No, I did not try SCons yet, but it seems to be worth a try IMHO.
Ciao, / /
/--/
/ / ANS
More information about the kde-core-devel
mailing list