[Lazarus] Adding Required Packages paths... dynamically

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Jul 20 11:24:51 CEST 2019


On Fri, 19 Jul 2019 00:26:49 -0300
"Marcos Douglas B. Santos via lazarus" <lazarus at lists.lazarus-ide.org>
wrote:

> Hi,
> 
> Imagine a package that has a dependency for another one. However, this
> dependency has a conditional to exists. So, I cannot add the Required
> Package by default — I'm talking about ZeosLib.
> 
> Then, I used Conditionals (script) for adding ZeosLib paths (-Fu, -Fi)
> into the paths of the package — amazing work in IDE, by the way.
> 
> In Custom Options | Conditionals, I have something like this:
> ===begin===
> if undefined(NOSYNDBZEOS) then
> begin
>   UnitPath +=
> ';$PkgOutDir(zcore);$PkgOutDir(zdbc);$PkgOutDir(zparsesql);$PkgOutDir(zplain)';
> IncPath += ';$(ProjOutDir);$PkgDir(zcore)\..\..\src'; end;
> ===end===
> 
> And it works. If user add the package into a project, he/she could
> compile with/without support to ZeosLib, just checking/unchecking some
> definition into Defines button. Excellent.
> 
> However, my only problem occur if user add zcomponent package, which
> belongs to ZeosLib. If so, I get some hints like this:
> ```
> Note: Duplicate unit "ZVariant" in "mormot_base 1.18", orphaned ppu
> "<my-path>\zeos\packages\lazarus\lib\zcore\x86_64-win64\ZVariant.ppu"
> Note: Duplicate unit "ZVariant" in "zcore 7.2.5",
> ppu="<my-path>\zeos\packages\lazarus\lib\zcore\x86_64-win64\ZVariant.ppu",
> source="<my-path>\zeos\src\core\ZVariant.pas"

It means: Two packages reach the same ppu and only one has a source
file. Hmm, that should not create a note.
I fixed a check in rev61607, please test with trunk.


> Note: Duplicate unit "ZVariables" in "mormot_base 1.18", orphaned ppu
> "<my-path>\zeos\packages\lazarus\lib\zcore\x86_64-win64\ZVariables.ppu"
> Note: Duplicate unit "ZVariables" in "zcore 7.2.5",
> ppu="<my-path>\zeos\packages\lazarus\lib\zcore\x86_64-win64\ZVariables.ppu",
> source="<my-path>\zeos\src\core\ZVariables.pas"
> ```
> 
> What I don't understand is:
> Adding ZeosLib into mormot_base package as a dependency (just for
> testing), I have the same paths as using Conditionals. Then, why the
> compiler show me these hints when I'm using ZeosLib paths
> "dynamically" by Conditionals?

These notes come from Lazarus, not fpc.


> What should I do to remove them?


Mattias



More information about the lazarus mailing list