[PATCH] Extra #include options in kconfig_compiler
David Faure
faure at kde.org
Tue Nov 6 21:30:47 GMT 2007
On Friday 05 October 2007, David Jarvie wrote:
> Attached is a patch to allow the specification of #include's in the source
> file generated by kconfig_compiler (as opposed to #include's in the header
> file which are currently catered for), by the addition of a
> SourceIncludeFiles keyword in the .kcfgc file. It seems sensible not to force
> the inclusion of unneeded #include statements in the generated header if they
> are only needed in the source. This will enable me to easily fix a circular
> #include chain in code I'm writing, which would need much more work to solve
> by other means. (The problem isn't because of lack of include guards, but due
> to classes needing each other to be defined.)
>
> The patch also allows the specification of #include "xxx.h" instead of
> #include <xxx.h> by enclosing the name of the header file in double quotes.
> For example, in the .kcfgc file:
>
> IncludeFiles=kglobal.h,\"myfile.h\"
> SourceIncludeFiles=\"project.h\",kurl.h
I see this was committed; good feature.
A related question: the .kcfg file can have <include> tags; this is redundant (equivalent) with IncludeFiles in the kcfgc, right?
However the .kcfg file seems like a better place for include specification to me, since it's closer to
where the includes are needed (e.g. when a default value needs a #include to compile).
The problem is that in the .kcfg there is no way to specify "source includes", it seems?
What do I miss? Is there a good reason for specifying includes in the .kcfgc rather than in the .kcfg,
assuming we add a <sourceinclude> or <include location="source"> or something to kcfg files?
--
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-core-devel
mailing list