Recent

Author Topic: Can a unit be used in a package conditionally?  (Read 2545 times)

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Can a unit be used in a package conditionally?
« on: August 31, 2018, 03:02:42 pm »
Zeos compilation is currenty broken in Linux.
I reported it to their bugtracker (see here), and they are asking if there is a way to include a unit in a package conditionally.

The problem is that Lazarus package is xml, not pascal, so IFDEF cannot be used.

Is it possible somehow? If not, can someone propose a simple workaround?

Thanks in advance.
« Last Edit: August 31, 2018, 03:05:06 pm by Zoran »

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Can a unit be used in a package conditionally?
« Reply #1 on: August 31, 2018, 03:40:37 pm »
Seems they found some workaround (see in link from my original post). :)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4467
  • I like bugs.
Re: Can a unit be used in a package conditionally?
« Reply #2 on: August 31, 2018, 07:24:51 pm »
Is it possible somehow? If not, can someone propose a simple workaround?
It is currently not possible. The only workaround is to include all needed code and then enable/disable parts of it using IFDEFs.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: Can a unit be used in a package conditionally?
« Reply #3 on: August 31, 2018, 10:16:25 pm »
What are the consequences of only having an build unit in the package?

Other then maybe the "publish" feature?

 

TinyPortal © 2005-2018