Compare commits

...

2 Commits

Author SHA1 Message Date
34fe915e38 win stuff 2024-03-11 16:37:06 +01:00
4e13dda29d wim stuff 2024-03-11 16:36:25 +01:00
8 changed files with 47 additions and 2 deletions

View File

@ -10,6 +10,11 @@ unix {
LIBS += -L/opt/ptu5/opt/build-ATBTariffCalculator-Desktop_Qt_5_12_12_GCC_64bit-Debug/CalculatorCInterface/ -lCalculatorCInterface
}
win32 {
INCLUDEPATH += C:\Users\G.Hoffmann\Downloads\libgit2-1.7.2\libgit2-1.7.2\include
LIBS += -LC:\build-ATBTariffCalculator-Desktop_Qt_6_5_0_MinGW_64_bit-Release\CalculatorCInterface\release -lCalculatorCInterface
}
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

View File

@ -26,13 +26,13 @@ int main(int argc, char *argv[])
//setDebugLevel(LOG_NOTICE);
}
#ifdef __linux__
#if 1
//TariffCalculatorHandle handle = NewTariffCalculator();
//DeleteTariffCalculator(handle);
if (InitGitLibrary() > 0) {
qCritical() << CloneRepository("https://git.mimbach49.de/GerhardHoffmann/customer_999.git", "/tmp/customer_999");
qCritical() << CloneRepository("https://git.mimbach49.de/GerhardHoffmann/customer_999.git", "C:\\tmp\\customer_999");
ShutdownGitLibrary();
}
#else

View File

@ -8,6 +8,11 @@ unix {
LIBS += -L/usr/lib64 -lgit2
}
win32 {
INCLUDEPATH += C:\Users\G.Hoffmann\Downloads\libgit2-1.7.2\libgit2-1.7.2\include
LIBS += -LC:\Users\G.Hoffmann\Downloads\libgit2-1.7.2\libgit2-1.7.2\build\Debug -lgit2
}
# INCLUDEPATH+=$$_PRO_FILE_PWD_/../Utilities/

BIN
windows/git2.dll Normal file

Binary file not shown.

BIN
windows/git2.exp Normal file

Binary file not shown.

BIN
windows/git2.lib Normal file

Binary file not shown.

BIN
windows/git2.pdb Normal file

Binary file not shown.

View File

@ -0,0 +1,35 @@
unit TariffCalculator;
{$mode ObjFPC}{$H+}
interface
uses
SysUtils, CTypes;
type
// Can't use the class directly, so it is treated as an opaque handle.
// THandle is guaranteed to have the right size, even on other platforms.
TariffCalculatorHandle = THandle;
function NewTariffCalculator: TariffCalculatorHandle; stdcall;
procedure DeleteTariffCalculator(handle: TariffCalculatorHandle); stdcall;
function InitGitLibrary: cint32; stdcall;
function ShutdownGitLibrary: cint32; stdcall;
function CloneRepository(var url; var local_path) : cint32; stdcall;
implementation
const
DLLName = 'CalculatorCInterface.dll';
function NewTariffCalculator: TariffCalculatorHandle; stdcall; external DLLName;
procedure DeleteTariffCalculator(handle: TariffCalculatorHandle); stdcall; external DLLName;
function InitGitLibrary: cint32; stdcall; external DLLName;
function ShutdownGitLibrary: cint32; stdcall; external DLLName;
function CloneRepository(var url; var local_path) : cint32; stdcall; external DLLName;
end.