idea about improving moc support

LiuCougar liucougar at gmail.com
Sat Oct 15 05:05:21 CEST 2005


There are some issues with current moc support in bksys:
1. Each invoking of scons, each cpp file is scaned to find moc includes;
2. Even every cpp file is scaned, the current implementation still
requires us to specify additional header files to generate extra moc
files

As scons built-in sourcescanner scans every source file for includes,
it would be better if we could incorporate the moc scanner there. The
attached two patch files was an attempt to do that:
please apply the automoc file in the kdelibs topdir, and apply the
other file to scons-local-0.96.91/SCons/Scanner/__init__.py (This is
the side effect of this: the scons needs a little patch to work with
this new mechanism)

The approach is to replace the standard sourcescanner with a custom
one, which will take care of moc files automatically.

There will be only one scan if the source file does not change, and no
moc file (even those private one) does not need to be specified
manually in SConscript files (see the automoc patch): so the above two
issues in current implementation are solved.

However, there are 2 new issues, which I think should be possible to fix:
1. moc files are created in source dir, rather than the build one
2. after the target is built successfully, if you remove all *.moc
files, scons has no idea how to generate it again

I think these two issues should be bugs (or inappropriate codings) in the patch

could someone try this?

Do you think this is the right way of handling moc files?

Regards,
Cougar
--
"People's characters are strengthened through struggle against
difficulties; they are weakened by comfort."
- Old Chinese adage
-------------- next part --------------
A non-text attachment was scrubbed...
Name: automoc
Type: application/octet-stream
Size: 8234 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20051015/b622ae1d/automoc.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: automoc_scons
Type: application/octet-stream
Size: 756 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20051015/b622ae1d/automoc_scons.obj


More information about the Kde-buildsystem mailing list