Hello,
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:
{$macro on}
{$define A:=5}
begin
writeln(A);
end.
But, the program
begin
writeln(A);
end.
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
command-line?
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
information.
thanks,
Dmitry
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel