Mattias Gaertner wrote:
On Fri, 02 Nov 2007 13:56:31 -0300
Luiz Americo Pereira Camara <[EMAIL PROTECTED]> wrote:

2)Make units packages/projects optional according to widgetset.
Concrete situation: LCL extensions package has a unit (OleUtils) that implements TOLEStream. It only makes sense in win32. Currently the
unit is added in all widgetsets but all code is wrapped around a
ifdef Windows define so is seen as a dummy unit in other widgetsets.

Let me know the wiki address to add these cases

http://wiki.lazarus.freepascal.org/Conditional_Compiler_Options


Thanks.
You also saved me from adding these cases ;-) . Thanks again.

About the notes  you added in the second case:

# All units should be added to the package, independent if they are used. If they not always used, you can already check the flag. If i uncheck the uses unit flag that unit will not be compiled in none cases. Nor in win32 (where is needed) neither in the other systems.

# The above example is about windows. That has nothing to do with the widgetset. The qt and gtk2 widgetsets are also running under windows.
Ok

# You can put units specific to targets into sub directories as demonstrated in the Lazarus and FPC sources. I already did that. I created a units/win32 dir with OleUtils.pas inside and put units\$(TargetOS)\ in Other Units path but the unit is not compiled even in win32. See modified package source attached.

# There is no real need for conditional options for units
Maybe there's already a solution to this case and i'm missing something.

Luiz

<?xml version="1.0"?>
<CONFIG>
  <Package Version="3">
    <PathDelim Value="\"/>
    <Name Value="lclextensions_package"/>
    <Author Value="Luiz Americo Pereira Camara"/>
    <CompilerOptions>
      <Version Value="5"/>
      <PathDelim Value="\"/>
      <SearchPaths>
        <IncludeFiles Value="include\$(LCLWidgetType)\"/>
        <OtherUnitFiles Value="units\$(TargetOS)\"/>
        <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(LCLWidgetType)"/>
      </SearchPaths>
      <CodeGeneration>
        <Generate Value="Faster"/>
      </CodeGeneration>
      <Other>
        <CompilerPath Value="$(CompPath)"/>
      </Other>
    </CompilerOptions>
    <Description Value="LCL Extensions provides additional functions to be used together with LCL
"/>
    <License Value="Modified LGPL
"/>
    <Version Minor="2"/>
    <Files Count="2">
      <Item1>
        <Filename Value="delphicompat.pas"/>
        <UnitName Value="DelphiCompat"/>
      </Item1>
      <Item2>
        <Filename Value="lclext.pas"/>
        <UnitName Value="LclExt"/>
      </Item2>
    </Files>
    <Type Value="RunAndDesignTime"/>
    <RequiredPkgs Count="1">
      <Item1>
        <PackageName Value="LCL"/>
      </Item1>
    </RequiredPkgs>
    <UsageOptions>
      <UnitPath Value="$(PkgOutDir)\"/>
    </UsageOptions>
    <PublishOptions>
      <Version Value="2"/>
      <DestinationDirectory Value="$(TestDir)\publishedpackage\"/>
      <IgnoreBinaries Value="False"/>
    </PublishOptions>
  </Package>
</CONFIG>

Reply via email to