[fpc-devel] macro through command line
skalogryz.lists at gmail.com
Mon Jan 18 17:27:35 CET 2016
Is it possible to pass a macro through command line (fpc 2.6.4)?
here's an example.
The following code compiles and works as expected:
But, the program
fails to compile with the following command line:
fpc -Sm -dA:=5 -va test.pas
The error is
test.pas(2,12) Error: Identifier not found "A"
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.
Is not possible to declare a global (or unit-specific) macro from
and they have to be declared in the unit interface part?
The ultimate goal is to actually get a *full path* of a unit during
compilation, and I was researching macros as an option to get the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel