mirror of https://gitlab.com/basile.b/dexed.git
#99, add a service allowing to select a compiler
This commit is contained in:
parent
6457a91839
commit
a0911a95ef
|
@ -788,7 +788,7 @@ begin
|
||||||
fCompilProc.OnTerminate:= @compProcTerminated;
|
fCompilProc.OnTerminate:= @compProcTerminated;
|
||||||
getOpts(fCompilProc.Parameters);
|
getOpts(fCompilProc.Parameters);
|
||||||
//getUpToDateObjects(fCompilProc.Parameters);
|
//getUpToDateObjects(fCompilProc.Parameters);
|
||||||
if CEProjectCompiler = gdc then
|
if CEProjectCompiler = TCECompiler.gdc then
|
||||||
fCompilProc.Parameters.Add('-gdc=gdc');
|
fCompilProc.Parameters.Add('-gdc=gdc');
|
||||||
fCompilProc.Execute;
|
fCompilProc.Execute;
|
||||||
end;
|
end;
|
||||||
|
@ -1082,20 +1082,20 @@ end;
|
||||||
procedure setCEProjectCompiler(value: TCECompiler);
|
procedure setCEProjectCompiler(value: TCECompiler);
|
||||||
begin
|
begin
|
||||||
case value of
|
case value of
|
||||||
dmd: CEProjectCompilerFilename := exeFullName('dmd' + exeExt);
|
TCECompiler.dmd: CEProjectCompilerFilename := exeFullName('dmd' + exeExt);
|
||||||
gdc: CEProjectCompilerFilename := exeFullName('gdmd' + exeExt);
|
TCECompiler.gdc: CEProjectCompilerFilename := exeFullName('gdmd' + exeExt);
|
||||||
ldc: CEProjectCompilerFilename := exeFullName('ldmd2' + exeExt);
|
TCECompiler.ldc: CEProjectCompilerFilename := exeFullName('ldmd2' + exeExt);
|
||||||
end;
|
end;
|
||||||
if (not CEProjectCompilerFilename.fileExists)
|
if (not CEProjectCompilerFilename.fileExists)
|
||||||
or CEProjectCompilerFilename.isEmpty then
|
or CEProjectCompilerFilename.isEmpty then
|
||||||
begin
|
begin
|
||||||
value := dmd;
|
value := TCECompiler.dmd;
|
||||||
CEProjectCompilerFilename:= 'dmd' + exeExt;
|
CEProjectCompilerFilename:= 'dmd' + exeExt;
|
||||||
end;
|
end;
|
||||||
CEProjectCompiler := value;
|
CEProjectCompiler := value;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
setCEProjectCompiler(dmd);
|
setCEProjectCompiler(TCECompiler.dmd);
|
||||||
RegisterClasses([TCENativeProject]);
|
RegisterClasses([TCENativeProject]);
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -258,7 +258,7 @@ type
|
||||||
destructor destroy; override;
|
destructor destroy; override;
|
||||||
procedure assign(source: TPersistent); override;
|
procedure assign(source: TPersistent); override;
|
||||||
procedure getOpts(list: TStrings; base: TOptsGroup = nil); override;
|
procedure getOpts(list: TStrings; base: TOptsGroup = nil); override;
|
||||||
procedure getCompilerSpecificOpts(list: TStrings; base: TOptsGroup = nil; compiler: TCECompiler = dmd);
|
procedure getCompilerSpecificOpts(list: TStrings; base: TOptsGroup = nil; compiler: TCECompiler = TCECompiler.dmd);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
(*****************************************************************************
|
(*****************************************************************************
|
||||||
|
@ -1209,7 +1209,7 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TOtherOpts.getCompilerSpecificOpts(list: TStrings; base:
|
procedure TOtherOpts.getCompilerSpecificOpts(list: TStrings; base:
|
||||||
TOptsGroup = nil; compiler: TCECompiler = dmd);
|
TOptsGroup = nil; compiler: TCECompiler = TCECompiler.dmd);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
str: string;
|
str: string;
|
||||||
|
|
|
@ -157,7 +157,7 @@ type
|
||||||
procedure setDubCompiler(value: TCECompiler);
|
procedure setDubCompiler(value: TCECompiler);
|
||||||
|
|
||||||
var
|
var
|
||||||
DubCompiler: TCECompiler = dmd;
|
DubCompiler: TCECompiler = TCECompiler.dmd;
|
||||||
DubCompilerFilename: string = 'dmd';
|
DubCompilerFilename: string = 'dmd';
|
||||||
|
|
||||||
const
|
const
|
||||||
|
@ -1219,13 +1219,13 @@ end;
|
||||||
procedure setDubCompiler(value: TCECompiler);
|
procedure setDubCompiler(value: TCECompiler);
|
||||||
begin
|
begin
|
||||||
case value of
|
case value of
|
||||||
dmd: DubCompilerFilename := exeFullName('dmd' + exeExt);
|
TCECompiler.dmd: DubCompilerFilename := exeFullName('dmd' + exeExt);
|
||||||
gdc: DubCompilerFilename := exeFullName('gdc' + exeExt);
|
TCECompiler.gdc: DubCompilerFilename := exeFullName('gdc' + exeExt);
|
||||||
ldc: DubCompilerFilename := exeFullName('ldc2' + exeExt);
|
TCECompiler.ldc: DubCompilerFilename := exeFullName('ldc2' + exeExt);
|
||||||
end;
|
end;
|
||||||
if (not DubCompilerFilename.fileExists) or DubCompilerFilename.isEmpty then
|
if (not DubCompilerFilename.fileExists) or DubCompilerFilename.isEmpty then
|
||||||
begin
|
begin
|
||||||
value := dmd;
|
value := TCECompiler.dmd;
|
||||||
DubCompilerFilename:= 'dmd' + exeExt;
|
DubCompilerFilename:= 'dmd' + exeExt;
|
||||||
end;
|
end;
|
||||||
DubCompiler := value;
|
DubCompiler := value;
|
||||||
|
@ -1233,7 +1233,7 @@ end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
setDubCompiler(dmd);
|
setDubCompiler(TCECompiler.dmd);
|
||||||
dubBuildOptions:= TCEDubBuildOptions.create(nil);
|
dubBuildOptions:= TCEDubBuildOptions.create(nil);
|
||||||
finalization
|
finalization
|
||||||
dubBuildOptions.free;
|
dubBuildOptions.free;
|
||||||
|
|
|
@ -386,6 +386,21 @@ type
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
DCompiler = (dmd, gdc, gdmd, ldc, ldmd, user1, user2);
|
||||||
|
|
||||||
|
(**
|
||||||
|
* Single service provided by the options editor.
|
||||||
|
*)
|
||||||
|
ICECompilerSelector = interface(ICESingleService)
|
||||||
|
// Indicates wether a D compiler is usable.
|
||||||
|
function isCompilerValid(value: DCompiler): boolean;
|
||||||
|
// Returns a D compiler exe filename.
|
||||||
|
function getCompilerPath(value: DCompiler): string;
|
||||||
|
// Fills value with the runtime/phobos import paths for a particular D compiler.
|
||||||
|
procedure getCompilerImports(value: DCompiler; paths: TStrings);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
TDCDCompletionKind = (
|
TDCDCompletionKind = (
|
||||||
dckClass,
|
dckClass,
|
||||||
dckInterface,
|
dckInterface,
|
||||||
|
@ -445,6 +460,7 @@ type
|
||||||
function getProjectGroup: ICEProjectGroup;
|
function getProjectGroup: ICEProjectGroup;
|
||||||
function getExplorer: ICEExplorer;
|
function getExplorer: ICEExplorer;
|
||||||
function getOptionsEditor: ICEOptionsEditor;
|
function getOptionsEditor: ICEOptionsEditor;
|
||||||
|
function getCompilerSelector: ICECompilerSelector;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
@ -589,6 +605,11 @@ function getOptionsEditor: ICEOptionsEditor;
|
||||||
begin
|
begin
|
||||||
exit(EntitiesConnector.getSingleService('ICEOptionsEditor') as ICEOptionsEditor);
|
exit(EntitiesConnector.getSingleService('ICEOptionsEditor') as ICEOptionsEditor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function getCompilerSelector: ICECompilerSelector;
|
||||||
|
begin
|
||||||
|
exit(EntitiesConnector.getSingleService('ICECompilerSelector') as ICECompilerSelector);
|
||||||
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -693,10 +693,10 @@ end;
|
||||||
procedure TCERunnableOptions.setCompiler(value: TCECompiler);
|
procedure TCERunnableOptions.setCompiler(value: TCECompiler);
|
||||||
begin
|
begin
|
||||||
case value of
|
case value of
|
||||||
ldc: if not exeInSysPath('ldmd2' + exeExt) then
|
TCECompiler.ldc: if not exeInSysPath('ldmd2' + exeExt) then
|
||||||
value := dmd;
|
value := TCECompiler.dmd;
|
||||||
gdc: if not exeInSysPath('gdmd' + exeExt) then
|
TCECompiler.gdc: if not exeInSysPath('gdmd' + exeExt) then
|
||||||
value := dmd;
|
value := TCECompiler.dmd;
|
||||||
end;
|
end;
|
||||||
fCompiler :=value;
|
fCompiler :=value;
|
||||||
end;
|
end;
|
||||||
|
@ -2604,9 +2604,9 @@ begin
|
||||||
dmdproc.OnTerminate:= @asyncprocTerminate;
|
dmdproc.OnTerminate:= @asyncprocTerminate;
|
||||||
dmdproc.Options := [poUsePipes, poStderrToOutPut];
|
dmdproc.Options := [poUsePipes, poStderrToOutPut];
|
||||||
case fRunnablesOptions.compiler of
|
case fRunnablesOptions.compiler of
|
||||||
dmd: dmdProc.Executable :='dmd' + exeExt;
|
TCECompiler.dmd: dmdProc.Executable :='dmd' + exeExt;
|
||||||
ldc: dmdProc.Executable :='ldmd2' + exeExt;
|
TCECompiler.ldc: dmdProc.Executable :='ldmd2' + exeExt;
|
||||||
gdc: dmdProc.Executable :='gdmd' + exeExt;
|
TCECompiler.gdc: dmdProc.Executable :='gdmd' + exeExt;
|
||||||
end;
|
end;
|
||||||
dmdproc.Parameters.Add(fDoc.fileName);
|
dmdproc.Parameters.Add(fDoc.fileName);
|
||||||
if not asObj then
|
if not asObj then
|
||||||
|
@ -2884,8 +2884,8 @@ begin
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
case fRunnablesOptions.compiler of
|
case fRunnablesOptions.compiler of
|
||||||
gdc: fRunProc.Parameters.add('--compiler=gdc');
|
TCECompiler.gdc: fRunProc.Parameters.add('--compiler=gdc');
|
||||||
ldc: fRunProc.Parameters.add('--compiler=ldc2');
|
TCECompiler.ldc: fRunProc.Parameters.add('--compiler=ldc2');
|
||||||
end;
|
end;
|
||||||
fRunProc.execute;
|
fRunProc.execute;
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue