On Thu, 30 Nov 2006, Marc Santhoff wrote:
> Hi,
>
> I know this is a question regarding fpc and lazarus, but I decided to
> post to this list:
>
> If one would want to run the complete sources of a project through a
> preprocessor transparently when compiling in the lazarus IDE, would this
> be possible with fpc and lazarus as they are now?
Well. I thought about this issue frequently.
FPC has no support for this currently.
It has only limited macro support, I'm sure you are aware of it, it's
documented.
> Or will it take implementing some pipeline hooks or the like in one or
> both of them?
>
> The goal in doing so would be using a specialized macro processor
> replacing tags in the source code before feeding through fpc.
The issue is not so easy. My first thought would be that this is
something for the IDE, as it 'knows' which files should be
preprocessed and which not, but actually doing so would require
a lot of filename juggling, as the files must exist on disk with
known extensions.
Leaving it to the compiler presents other problems: the compiler
has no way to know which files should be preprocessed or not.
A second problem is that these hooks would seriously affect
speed, and I don't think anyone wishes to diminish the speed.
My conclusion was that such support should be implemented in
the IDE. My idea was that in the 'File - New' dialog, a new
item would appear: "Unit template". This would be treated as
a regular unit, but would have a flag set causing the IDE
1. To change the extension to .tpp (or .tpa or whatever).
2. Whenever a change is detected to such a unit, the IDE
runs it through the preprocessor (definable per project)
and saves the output with name .pp
Obviously, the flag should be settable on any unit, at which
point the IDE should offer to change the extension.
But that was just my idea.
Lack of time prohibited starting this topic :-)
Michael.
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives