I am making my own reusable library and in one of the units I want include extra methods and functions etc to support lcl/vcl more, but I also want to include other 3rd party controls such as SynEdit.
Lets say you have a uses clause like so,
{$IFDEF FPC}
Windows,
SysUtils,
Classes;
{$ENDIF}
If I were to add SynEdit above, create a new project that uses the above unit this would compile under Lazarus since it's pre installed, but in Delphi it would error because by default Delphi has no knowledge of SynEdit.
I think I need defines, so for example in my unit above Im thinking I could use something like,
{$IFDEF SYNEDIT}
SynEdit;
{$ENDIF}
And whenever I create a new project that uses this unit, I could write {$DEFINE SYNEDIT} from the project that uses my unit and that would tell my unit that the project also wants access to the extra synedit related methods and functions I could code.
It never gets triggered though, I could write anything in place of SynEdit; and the compiler never complains, likely because it never gets past {$IFDEF SYNEDIT}
Hope this makes sense, basically I want to know how I can let any project, if it defines {$DEFINE SYNEDIT} to let it access those extra methods and functions from my unit, I could wrap them in {$IFDEF SYNEDIT} for example, this way the compiler will never throw an error.
Another way would be to somehow determine if the units exists in the library path but I am unsure, I think my basic understanding of defines is probably the way to do it but Im possibly doing something wrong.