Your only option, for conditional defines, is to put them in a .inc file which you then include in all three units.
However, conditional defines, and $IFDEF
are not the only way to achieve conditional compilation. You might consider using a boolean constant instead of a conditional. So long as it is visible in all three units, you can use $IF
rather than $IFDEF
.
{$IF MyConstant}
....
{$IFEND}
Or, starting in XE3, you can terminate the {$IF}
with {$ENDIF}
.
Personally I tend to favour this latter approach when trying to compile conditionally and don't want the condition to have global scope.