[fpc-devel] macro through command line

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Jan 18 17:41:11 CET 2016


Dmitry Boyarintsev wrote:
> even though, it seems like -d parameter was handled as it should:
> [0.009] Handling option "-Sm"
> [0.009] interpreting option "-Sm"
> [0.009] Handling option "-dA:=5"
> [0.009] interpreting option "-dA:=5"
> [0.009] Macro A set to 5
>
> Naturally the actual value (5) is respected by conditional $if statements.

-d sets a compile-time variable, which is not the same as a macro: 
http://www.freepascal.org/docs-html/prog/progse6.html

> Is not possible to declare a global (or unit-specific) macro from
> command-line?

No.

> and they have to be declared in the unit interface part?

Yes, or in an include file included in the unit interface.


Jonas



More information about the fpc-devel mailing list