mirror of https://gitlab.com/basile.b/dexed.git
improve ldc library path detection
This commit is contained in:
parent
0cc827bb2a
commit
323ea7cfdf
|
@ -719,15 +719,30 @@ end;
|
||||||
|
|
||||||
procedure TCompilersPathsEditor.autoDetectLDC;
|
procedure TCompilersPathsEditor.autoDetectLDC;
|
||||||
var
|
var
|
||||||
|
i: integer;
|
||||||
path: string;
|
path: string;
|
||||||
|
str: TStringList;
|
||||||
begin
|
begin
|
||||||
path := exeFullName('ldc2' + exeExt);
|
path := exeFullName('ldc2' + exeExt);
|
||||||
if path.fileExists then
|
if path.fileExists then
|
||||||
begin
|
begin
|
||||||
fPaths.LdcExeName:= path;
|
fPaths.LdcExeName:= path;
|
||||||
path := path.extractFilePath.extractFilePath + DirectorySeparator + 'import';
|
str := TStringList.Create;
|
||||||
if path.dirExists then
|
try
|
||||||
fPaths.LdcRuntimePath:=path;
|
path := path.extractFileDir.extractFilePath;
|
||||||
|
FindAllDirectories(str, path, true);
|
||||||
|
for path in str do
|
||||||
|
begin
|
||||||
|
i := pos('import' + DirectorySeparator + 'ldc', path);
|
||||||
|
if i > 0 then
|
||||||
|
begin
|
||||||
|
fPaths.LdcRuntimePath:= path[1..i + 5];
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
str.Free;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
Loading…
Reference in New Issue