[Lazarus] Compiler Options - Conditionally add a package dependency?
Michael Van Canneyt
michael at freepascal.org
Thu Jul 9 17:58:36 CEST 2015
On Thu, 9 Jul 2015, Graeme Geldenhuys wrote:
> Hi,
>
> I have two independent packages. I would like my project to toggle
> between either one (but never both at the same time). Both have a unit
> with the exact same name, hence both packages can't be added to the
> dependency list at the same time.
>
> Is there a way with the Compiler Options -> Other (or Additions and
> Overrides) to include a specific package based on a compiler define?
>
> eg:
> if defined UsePackageA
> PackageDependecy.Add(PackageA)
> else
> PackageDependency.Add(PackageB)
>
> Well something like that at least.
I would even go further, and have a package included or not depending on the OS.
Similar, I think it should be possible to include a unit in a package, depending on the OS.
In short, a set of conditions for package dependencies and contains lists.
Michael.
More information about the Lazarus
mailing list