I have the following problem in Delphi Berlin.
I have a datamodule that is keeping multiple platform functions with compiler directive.
For example
{$IFDEF ISVCLAPP} functions for VCL
{$IFDEF ISFMXAPP} functions for FMX
and so on
however i cannot get rid of FireDAC.VCLUI.Wait in the uses clause in an Android (FMX) enviroment.
I put FireDAC.FMXUI.Wait but it seems ignored by the compiler and keep adding regardles I do the VCLUI unit.
I belive that is something in the code that keeps telling the delphi enviroment that this is a VCL framework. Is there a way to find something like this?
Unfortunately there is no built-in define one can check, but you can make your own. Create (or extend in a meaningful way) a file named UserTools.proj in %APPDATA%\Embarcadero\BDS\18.0 (for Delphi Berlin) with the following content:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DCC_Define>FrameWork_$(FrameworkType);$(DCC_Define)</DCC_Define>
</PropertyGroup>
</Project>
This allows to check for the current framework in your source files like this:
{$IFDEF FrameWork_VCL}
or
{$IFDEF FrameWork_FMX}
Be aware that in some cases neither of these two may be defined at all.
Note that the file mentioned above is located in your user appdata folder, so other users need their own copy to make use of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With