Skip to content

Commit

Permalink
Refactor for Lazarus package. Dynamic loading is now the default for …
Browse files Browse the repository at this point in the history
…Lazarus packages.
  • Loading branch information
[email protected] committed Mar 18, 2022
1 parent 81e3b4b commit df75825
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 56 deletions.
6 changes: 4 additions & 2 deletions src/hidapi.inc
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ uses
0.11.2 0112
}
{$ifndef HIDAPI_VERSION}
{$ERROR For static linking you need to define the version of the HidApi library.
i.e. for 0.9.0 use HIDAPI_VERSION = 0090 or for 0.10.0 HIDAPI_VERSION = 0100 }
{$warning For static loading you need to define the version of the HidApi library. }
{$warning i.e. for 0.9.0 use HIDAPI_VERSION = 0090 or for 0.10.0 HIDAPI_VERSION = 0100 etc. }
{$warning else static loading defaults to 0.9.0 hidapi version library .}
{$define HIDAPI_VERSION := 0090}
{$endif}
{$endif}

Expand Down
1 change: 1 addition & 0 deletions src/hidapi.pas
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
}
unit hidapi;

{$define HIDAPI_LOAD_DYNAMICALLY}
{$i hidapi.inc}

end.
74 changes: 37 additions & 37 deletions src/hidapi_pkg.lpk
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Package Version="5">
<PathDelim Value="\"/>
<Name Value="hidapi_pkg"/>
<Author Value="Bernd Kreuss &lt;[email protected]>, Dimitrios Chr. Ioannidis &lt;[email protected]>"/>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
</CompilerOptions>
<Description Value="libhidapi bindings. Supports Windows, Linux and macOS."/>
<License Value="GPL 2"/>
<Version Minor="3"/>
<Files Count="1">
<Item1>
<Filename Value="hidapi.pas"/>
<UnitName Value="hidapi"/>
</Item1>
</Files>
<CompatibilityMode Value="True"/>
<RequiredPkgs Count="1">
<Item1>
<PackageName Value="FCL"/>
</Item1>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)"/>
</UsageOptions>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
</Package>
</CONFIG>
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Package Version="4">
<PathDelim Value="\"/>
<Name Value="hidapi_pkg"/>
<Type Value="RunTimeOnly"/>
<Author Value="Bernd Kreuss &lt;[email protected]>, Dimitrios Chr. Ioannidis &lt;[email protected]>"/>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
</CompilerOptions>
<Description Value="libhidapi bindings. Supports Windows, Linux and macOS."/>
<License Value="GPL 2"/>
<Version Minor="3"/>
<Files Count="1">
<Item1>
<Filename Value="hidapi.pas"/>
<UnitName Value="hidapi"/>
</Item1>
</Files>
<RequiredPkgs Count="1">
<Item1>
<PackageName Value="FCL"/>
</Item1>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)"/>
</UsageOptions>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
</Package>
</CONFIG>
30 changes: 15 additions & 15 deletions src/hidapi_pkg.pas
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{ This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install the package.
}

unit hidapi_pkg;

{$warn 5023 off : no warning about unused units}
interface

uses
hidapi_dyn;

implementation

end.
{ This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install the package.
}

unit hidapi_pkg;

{$warn 5023 off : no warning about unused units}
interface

uses
hidapi;

implementation

end.
3 changes: 1 addition & 2 deletions src/hidapi_dyn.pas → src/hidapi_static.pas
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
You should have received a copy of the GNU Library General Public License along with this library; if not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
}
unit hidapi_dyn;
unit hidapi;

{$define HIDAPI_LOAD_DYNAMICALLY}
{$i hidapi.inc}

end.

0 comments on commit df75825

Please sign in to comment.