[Lazarus] Adding Required Packages paths... dynamically

Marcos Douglas B. Santos md at delfire.net
Sun Jul 21 16:56:21 CEST 2019


On Sat, Jul 20, 2019 at 6:24 AM Mattias Gaertner via lazarus
<lazarus at lists.lazarus-ide.org> wrote:
>
> 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.

Thanks.
Do you think this is a hack to add packages dynamically, or is it the right way?

regards,
Marcos Douglas


More information about the lazarus mailing list