[Lazarus] -WG compiler parameter issue in cross-platform projects

Florian Klämpfl florian at freepascal.org
Thu Jul 14 22:37:06 CEST 2011


Am 14.07.2011 22:25, schrieb Felipe Monteiro de Carvalho:
> On Thu, Jul 14, 2011 at 7:07 PM, Florian Klämpfl <florian at freepascal.org> wrote:
>> Pretty simple: most target specific switches were never silently ignored
>> if they didn't apply to the current target. A arm compiler complains
>> also about a -Oppentium. -WG was one of the few examples of the group of
>> the -W switches which was silently ignored, probably due to historic
>> reasons.
> 
> I think that the major problem will be trying to create a
> cross-platform makefile for fpc apps. I for one can create simple
> makefiles, but I have no idea how to add if clauses in makefiles to
> select the correct options for each platform.

If you don't want to use a more complex file, use either
* a project specific fpc configuration file with appropriate ifdefs
* put an $apptype directive into your main program file with appropriate
ifdefs

> 
> Plus, while most options are optional, -WG is pretty much mandatory in
> Windows GUI apps, so you can't just live without it.
> 

I never use -WG but always apptype, the less command line options are
needed to compile a program, the easier the build method (e.g. IDE,
Makefile, fpmake) can be changed.




More information about the Lazarus mailing list