On Thu, Jul 9, 2015 at 12:58 PM, Michael Van Canneyt <mich...@freepascal.org> wrote: > > > 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.
I would even go further even more: If we have two units with the same name, would be better if were possible to create an alias namespace for each unit, like C# does. https://msdn.microsoft.com/en-us/library/aa664765(v=vs.71).aspx But you, guys, will talk about "an Unit is a namespace" -- we know this is true -- and this is not necessary... anyway. Best regards, Marcos Douglas -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus