mirror of https://gitlab.com/basile.b/dexed.git
fix libman libfiles were passed as -I and libpath as source lib.
This commit is contained in:
parent
67fba2aaae
commit
2ca12fa046
|
@ -41,8 +41,8 @@ type
|
|||
constructor create(aOwner: TComponent); override;
|
||||
destructor destroy; override;
|
||||
//
|
||||
procedure getAdditionalSources(const someAliases, aList: TStrings);
|
||||
procedure getAdditionalImport(const someAliases, aList: TStrings);
|
||||
procedure getLibFiles(const someAliases, aList: TStrings);
|
||||
procedure getLibSources(const someAliases, aList: TStrings);
|
||||
//
|
||||
procedure loadFromFile(const aFilename: string);
|
||||
procedure saveToFile(const aFilename: string);
|
||||
|
@ -71,60 +71,47 @@ end;
|
|||
|
||||
procedure TLibraryManager.updateDCD;
|
||||
var
|
||||
itm: TCollectionItem;
|
||||
itmt: TLibraryItem;
|
||||
itm: TLibraryItem;
|
||||
i: NativeInt;
|
||||
begin
|
||||
if not dcdOn then exit;
|
||||
//
|
||||
for itm in fCol do
|
||||
for i := 0 to fCol.Count-1 do
|
||||
begin
|
||||
itmt := TLibraryItem(itm);
|
||||
ce_dcd.addDcdImport(itmt.libSourcePath);
|
||||
itm := TLibraryItem(fCol.Items[i]);
|
||||
ce_dcd.addDcdImport(itm.libSourcePath);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TLibraryManager.getAdditionalSources(const someAliases, aList: TStrings);
|
||||
procedure TLibraryManager.getLibFiles(const someAliases, aList: TStrings);
|
||||
var
|
||||
itm: TCollectionItem;
|
||||
itmt: TLibraryItem;
|
||||
ext, src: string;
|
||||
srcs: TStringList;
|
||||
itm: TLibraryItem;
|
||||
i: NativeInt;
|
||||
begin
|
||||
for itm in fCol do
|
||||
for i := 0 to fCol.Count-1 do
|
||||
begin
|
||||
itmt := TLibraryItem(itm);
|
||||
itm := TLibraryItem(fCol.Items[i]);
|
||||
if someAliases <> nil then
|
||||
if someAliases.IndexOf(itmt.libAlias) = -1 then continue;
|
||||
if someAliases.IndexOf(itm.libAlias) = -1 then continue;
|
||||
//
|
||||
srcs := TStringList.Create;
|
||||
try
|
||||
listFiles(srcs, itmt.libSourcePath, true);
|
||||
for src in srcs do
|
||||
begin
|
||||
ext := extractFileExt(src);
|
||||
if DExtList.IndexOf(ext) = -1 then continue;
|
||||
if aList.IndexOf(src) <> -1 then continue;
|
||||
aList.Add(src);
|
||||
end;
|
||||
finally
|
||||
srcs.Free;
|
||||
end;
|
||||
if aList.IndexOf(itm.libFile) <> -1 then continue;
|
||||
aList.Add(itm.libFile);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TLibraryManager.getAdditionalImport(const someAliases, aList: TStrings);
|
||||
procedure TLibraryManager.getLibSources(const someAliases, aList: TStrings);
|
||||
var
|
||||
itm: TCollectionItem;
|
||||
itmt: TLibraryItem;
|
||||
itm: TLibraryItem;
|
||||
i: NativeInt;
|
||||
begin
|
||||
for itm in fCol do
|
||||
for i := 0 to fCol.Count-1 do
|
||||
begin
|
||||
itmt := TLibraryItem(itm);
|
||||
itm := TLibraryItem(fCol.Items[i]);
|
||||
if someAliases <> nil then
|
||||
if someAliases.IndexOf(itmt.libAlias) = -1 then continue;
|
||||
if someAliases.IndexOf(itm.libAlias) = -1 then continue;
|
||||
//
|
||||
if aList.IndexOf(itmt.libFile) <> -1 then continue;
|
||||
aList.Add('-I' + itmt.libFile);
|
||||
if aList.IndexOf(itm.libSourcePath) <> -1 then continue;
|
||||
aList.Add('-I' + itm.libSourcePath);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
@ -1128,8 +1128,8 @@ begin
|
|||
dmdproc.Parameters.Add('-w');
|
||||
dmdproc.Parameters.Add('-wi');
|
||||
dmdproc.Parameters.Add('-of' + fname {$IFDEF WINDOWS}+ '.exe'{$ENDIF});
|
||||
LibraryManager.getAdditionalSources(nil, dmdproc.Parameters);
|
||||
LibraryManager.getAdditionalImport(nil, dmdproc.Parameters);
|
||||
LibraryManager.getLibFiles(nil, dmdproc.Parameters);
|
||||
LibraryManager.getLibSources(nil, dmdproc.Parameters);
|
||||
dmdproc.Execute;
|
||||
repeat ProcessOutputToMsg(dmdproc, mcEditor) until not dmdproc.Running;
|
||||
if (dmdProc.ExitStatus = 0) then
|
||||
|
@ -1143,8 +1143,8 @@ begin
|
|||
runproc.Execute;
|
||||
repeat ProcessOutputToMsg(runproc, mcEditor) until not runproc.Running;
|
||||
{$IFDEF MSWINDOWS}
|
||||
sysutils.DeleteFile(fname + '.exe');
|
||||
sysutils.DeleteFile(fname + '.obj');
|
||||
//sysutils.DeleteFile(fname + '.exe');
|
||||
//sysutils.DeleteFile(fname + '.obj');
|
||||
{$ELSE}
|
||||
sysutils.DeleteFile(fname);
|
||||
sysutils.DeleteFile(fname + '.o');
|
||||
|
|
|
@ -259,8 +259,8 @@ begin
|
|||
//
|
||||
if fLibMan <> nil then
|
||||
begin
|
||||
fLibMan.getAdditionalSources(fLibAliases, aList);
|
||||
fLibMan.getAdditionalImport(fLibAliases, aList);
|
||||
fLibMan.getLibFiles(fLibAliases, aList);
|
||||
fLibMan.getLibSources(fLibAliases, aList);
|
||||
end;
|
||||
//
|
||||
TCompilerConfiguration(fOptsColl.Items[fConfIx]).getOpts(aList);
|
||||
|
|
|
@ -405,8 +405,8 @@ begin
|
|||
end;
|
||||
//adds the libman entries
|
||||
with CEMainForm do begin
|
||||
Librarymanager.getAdditionalSources(nil, dmdproc.Parameters);
|
||||
Librarymanager.getAdditionalImport(nil, dmdproc.Parameters);
|
||||
Librarymanager.getLibFiles(nil, dmdproc.Parameters);
|
||||
Librarymanager.getLibSources(nil, dmdproc.Parameters);
|
||||
end;
|
||||
//
|
||||
dmdproc.Execute;
|
||||
|
|
Loading…
Reference in New Issue