compilers paths, add detection of LDC2 and GDC when extracted from rls archive

This commit is contained in:
Basile Burg 2017-03-11 17:17:03 +01:00
parent 9cd9eefc91
commit cd686732d7
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
3 changed files with 33 additions and 4 deletions

View File

@ -6,7 +6,7 @@ object CompilersPathsEditor: TCompilersPathsEditor
Caption = 'CompilersPathsEditor'
ClientHeight = 869
ClientWidth = 460
LCLVersion = '1.6.0.4'
LCLVersion = '1.6.4.0'
object ScrollBox1: TScrollBox
Left = 0
Height = 869

View File

@ -693,13 +693,42 @@ begin
end;
procedure TCompilersPathsEditor.autoDetectGDC;
var
path: string;
str: TStringList;
begin
//TODO-cCompilerPaths: detect GDC
path := exeFullName('gdc' + exeExt);
if path.fileExists then
begin
fPaths.GdcExeName:= path;
str := TStringList.Create;
try
path := path.extractFileDir.extractFilePath;
FindAllDirectories(str, path, true);
for path in str do
if pos('include' + DirectorySeparator + 'd', path) > 0 then
begin
fPaths.GdcRuntimePath:= path;
break;
end;
finally
str.Free;
end;
end;
end;
procedure TCompilersPathsEditor.autoDetectLDC;
var
path: string;
begin
//TODO-cCompilerPaths: detect LDC
path := exeFullName('ldc2' + exeExt);
if path.fileExists then
begin
fPaths.LdcExeName:= path;
path := path.extractFilePath.extractFilePath + DirectorySeparator + 'import';
if path.dirExists then
fPaths.LdcRuntimePath:=path;
end;
end;
{$ENDREGION}

View File

@ -113,7 +113,7 @@ end;
function demangle(const value: string): string;
begin
if demangler.active and (pos('_D', value) <> -1) then
if demangler.active and (pos('_D', value) > 0) then
begin
demangler.output.Clear;
demangler.demangle(value);