mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 02:16:14 +02:00
IDE: comp opts dlg: new build modes
git-svn-id: trunk@18275 -
This commit is contained in:
parent
20c99e44fb
commit
7f7c0b3387
@ -112,7 +112,7 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function FindModeWithIdentifier(Identifier: string; out BuildModes: TIDEBuildModes;
|
function FindModeWithIdentifier(Identifier: string; out BuildModes: TIDEBuildModes;
|
||||||
out BuildMode: TIDEBuildMode): boolean;
|
out BuildMode: TIDEBuildMode): boolean;
|
||||||
function GetUniqueModeName: string;
|
function GetUniqueModeName(CheckToo: TIDEBuildModes): string;
|
||||||
property Evaluator: TExpressionEvaluator read FEvaluator;
|
property Evaluator: TExpressionEvaluator read FEvaluator;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3298,7 +3298,7 @@ begin
|
|||||||
Result:=false;
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBuildModeSet.GetUniqueModeName: string;
|
function TBuildModeSet.GetUniqueModeName(CheckToo: TIDEBuildModes): string;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
BuildModes: TIDEBuildModes;
|
BuildModes: TIDEBuildModes;
|
||||||
@ -3308,7 +3308,8 @@ begin
|
|||||||
repeat
|
repeat
|
||||||
inc(i);
|
inc(i);
|
||||||
Result:='Mode'+IntToStr(i);
|
Result:='Mode'+IntToStr(i);
|
||||||
until not FindModeWithIdentifier(Result,BuildModes,BuildMode);
|
until (not FindModeWithIdentifier(Result,BuildModes,BuildMode))
|
||||||
|
and ((CheckToo=nil) or (CheckToo.IndexOfIdentifier(Result)<0));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TIDEBuildMode }
|
{ TIDEBuildMode }
|
||||||
@ -3316,8 +3317,8 @@ end;
|
|||||||
procedure TIDEBuildMode.SetIdentifier(const AValue: string);
|
procedure TIDEBuildMode.SetIdentifier(const AValue: string);
|
||||||
begin
|
begin
|
||||||
if FIdentifier=AValue then exit;
|
if FIdentifier=AValue then exit;
|
||||||
if (FIdentifier='') or (not IsValidIdent(FIdentifier)) then
|
if (AValue='') or (not IsValidIdent(AValue)) then
|
||||||
raise Exception.Create('TIDEBuildMode.SetIdentifier invalid identifier: '+FIdentifier);
|
raise Exception.Create('TIDEBuildMode.SetIdentifier invalid identifier: '+AValue);
|
||||||
FIdentifier:=AValue;
|
FIdentifier:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ uses
|
|||||||
TransferMacros, PathEditorDlg, LazarusIDEStrConsts, IDEOptionDefs, LazConf,
|
TransferMacros, PathEditorDlg, LazarusIDEStrConsts, IDEOptionDefs, LazConf,
|
||||||
IDEProcs, IDEImagesIntf, ShowCompilerOpts, Project, PackageDefs,
|
IDEProcs, IDEImagesIntf, ShowCompilerOpts, Project, PackageDefs,
|
||||||
CompilerOptions, CheckCompilerOpts, CompOptsModes,
|
CompilerOptions, CheckCompilerOpts, CompOptsModes,
|
||||||
Compiler_Conditionals_Options, compiler_buildmodes_options;
|
Compiler_Conditionals_Options, Compiler_BuildModes_Options;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ Compiler options form }
|
{ Compiler options form }
|
||||||
@ -62,13 +62,7 @@ type
|
|||||||
{ TfrmCompilerOptions }
|
{ TfrmCompilerOptions }
|
||||||
|
|
||||||
TfrmCompilerOptions = class(TForm)
|
TfrmCompilerOptions = class(TForm)
|
||||||
chkUseExternalDbgSyms: TCheckBox;
|
|
||||||
BuildModesFrame: TCompOptBuildModesFrame;
|
|
||||||
ConditionalOptionsFrame: TCompOptsConditionalsFrame;
|
|
||||||
ConditionalsGroupBox: TGroupBox;
|
|
||||||
MainNoteBook: TNoteBook;
|
MainNoteBook: TNoteBook;
|
||||||
BtnPanel: TPanel;
|
|
||||||
ConditionalPage: TPage;
|
|
||||||
|
|
||||||
{ Search Paths Controls }
|
{ Search Paths Controls }
|
||||||
PathPage: TPage;
|
PathPage: TPage;
|
||||||
@ -150,6 +144,7 @@ type
|
|||||||
chkUseValgrind: TCheckBox;
|
chkUseValgrind: TCheckBox;
|
||||||
chkGenGProfCode: TCheckBox;
|
chkGenGProfCode: TCheckBox;
|
||||||
chkSymbolsStrip: TCheckBox;
|
chkSymbolsStrip: TCheckBox;
|
||||||
|
chkUseExternalDbgSyms: TCheckBox;
|
||||||
|
|
||||||
grpLinkLibraries: TGroupBox;
|
grpLinkLibraries: TGroupBox;
|
||||||
chkLinkSmart: TCheckBox;
|
chkLinkSmart: TCheckBox;
|
||||||
@ -176,6 +171,12 @@ type
|
|||||||
grpCustomOptions: TGroupBox;
|
grpCustomOptions: TGroupBox;
|
||||||
memCustomOptions: TMemo;
|
memCustomOptions: TMemo;
|
||||||
|
|
||||||
|
{ Conditionals }
|
||||||
|
ConditionalPage: TPage;
|
||||||
|
ConditionalOptionsFrame: TCompOptsConditionalsFrame;
|
||||||
|
ConditionalsGroupBox: TGroupBox;
|
||||||
|
BuildModesFrame: TCompOptBuildModesFrame;
|
||||||
|
|
||||||
{ Inherited Options }
|
{ Inherited Options }
|
||||||
InheritedPage: TPage;
|
InheritedPage: TPage;
|
||||||
InhSplitter: TSplitter;
|
InhSplitter: TSplitter;
|
||||||
@ -220,6 +221,7 @@ type
|
|||||||
ExecuteAfterShowAllCheckBox: TCheckBox;
|
ExecuteAfterShowAllCheckBox: TCheckBox;
|
||||||
|
|
||||||
{ Buttons }
|
{ Buttons }
|
||||||
|
BtnPanel: TPanel;
|
||||||
btnShowOptions: TBitBtn;
|
btnShowOptions: TBitBtn;
|
||||||
btnOK: TBitBtn;
|
btnOK: TBitBtn;
|
||||||
btnCancel: TBitBtn;
|
btnCancel: TBitBtn;
|
||||||
@ -269,9 +271,9 @@ type
|
|||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
procedure GetCompilerOptions;
|
procedure GetCompilerOptions; // options to dialog
|
||||||
procedure GetCompilerOptions(SrcCompilerOptions: TBaseCompilerOptions);
|
procedure GetCompilerOptions(SrcCompilerOptions: TBaseCompilerOptions);
|
||||||
function PutCompilerOptions(CheckAndWarn: TCheckCompileOptionsMsgLvl): boolean;
|
function PutCompilerOptions(CheckAndWarn: TCheckCompileOptionsMsgLvl): boolean; // dlg to options
|
||||||
function PutCompilerOptions(CheckAndWarn: TCheckCompileOptionsMsgLvl;
|
function PutCompilerOptions(CheckAndWarn: TCheckCompileOptionsMsgLvl;
|
||||||
DestCompilerOptions: TBaseCompilerOptions): boolean;
|
DestCompilerOptions: TBaseCompilerOptions): boolean;
|
||||||
public
|
public
|
||||||
@ -690,6 +692,7 @@ begin
|
|||||||
// conditional
|
// conditional
|
||||||
{$IFDEF EnableBuildModes}
|
{$IFDEF EnableBuildModes}
|
||||||
ConditionalOptionsFrame.Conditionals:=Options.Conditionals as TCompOptConditionals;
|
ConditionalOptionsFrame.Conditionals:=Options.Conditionals as TCompOptConditionals;
|
||||||
|
BuildModesFrame.BuildModes:=Options.BuildModes as TIDEBuildModes;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
// inherited tab
|
// inherited tab
|
||||||
@ -881,6 +884,7 @@ begin
|
|||||||
if not CheckPutSearchPath('debugger search path',OldPath,Options.GetDebugPath(false)) then
|
if not CheckPutSearchPath('debugger search path',OldPath,Options.GetDebugPath(false)) then
|
||||||
exit(false);
|
exit(false);
|
||||||
|
|
||||||
|
// ToDo: will be replaced by buildmodes
|
||||||
i:=LCLWidgetTypeComboBox.Itemindex;
|
i:=LCLWidgetTypeComboBox.Itemindex;
|
||||||
if i<=0 then
|
if i<=0 then
|
||||||
Options.LCLWidgetType:=''
|
Options.LCLWidgetType:=''
|
||||||
@ -983,6 +987,9 @@ begin
|
|||||||
Options.WriteFPCLogo := Checked[19];
|
Options.WriteFPCLogo := Checked[19];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// conditionals
|
||||||
|
// these are all done via the frames
|
||||||
|
|
||||||
// other
|
// other
|
||||||
Options.DontUseConfigFile := not chkConfigFile.Checked;
|
Options.DontUseConfigFile := not chkConfigFile.Checked;
|
||||||
Options.CustomConfigFile := chkCustomConfigFile.Checked;
|
Options.CustomConfigFile := chkCustomConfigFile.Checked;
|
||||||
|
@ -272,7 +272,7 @@
|
|||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<ResourceBaseClass Value="Frame"/>
|
<ResourceBaseClass Value="Frame"/>
|
||||||
<UnitName Value="compiler_buildmodes_options"/>
|
<UnitName Value="Compiler_BuildModes_Options"/>
|
||||||
</Unit33>
|
</Unit33>
|
||||||
<Unit34>
|
<Unit34>
|
||||||
<Filename Value="sourceeditor.pp"/>
|
<Filename Value="sourceeditor.pp"/>
|
||||||
@ -504,6 +504,11 @@
|
|||||||
<OtherUnitFiles Value="frames/;../debugger/;../debugger/frames/"/>
|
<OtherUnitFiles Value="frames/;../debugger/;../debugger/frames/"/>
|
||||||
<UnitOutputDirectory Value="$(LazarusDir)/units/$(TargetCPU)-$(TargetOS)"/>
|
<UnitOutputDirectory Value="$(LazarusDir)/units/$(TargetCPU)-$(TargetOS)"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<CStyleOperator Value="False"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
<Other>
|
<Other>
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
</Other>
|
</Other>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* *
|
* *
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
}
|
}
|
||||||
unit compiler_buildmodes_options;
|
unit Compiler_BuildModes_Options;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ procedure TCompOptBuildModesFrame.NewSpeedButtonClick(Sender: TObject);
|
|||||||
var
|
var
|
||||||
NewIdentifier: String;
|
NewIdentifier: String;
|
||||||
begin
|
begin
|
||||||
NewIdentifier:=GlobalBuildModeSet.GetUniqueModeName;
|
NewIdentifier:=GlobalBuildModeSet.GetUniqueModeName(BuildModes);
|
||||||
BuildModes.Add(NewIdentifier);
|
BuildModes.Add(NewIdentifier);
|
||||||
ModesGrid.RowCount:=BuildModes.Count;
|
ModesGrid.RowCount:=BuildModes.Count;
|
||||||
ModesGrid.Cells[0,BuildModes.Count-1]:=NewIdentifier;
|
ModesGrid.Cells[0,BuildModes.Count-1]:=NewIdentifier;
|
||||||
@ -183,12 +183,29 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCompOptBuildModesFrame.UpdateButtons;
|
procedure TCompOptBuildModesFrame.UpdateButtons;
|
||||||
|
var
|
||||||
|
BuildMode: TIDEBuildMode;
|
||||||
begin
|
begin
|
||||||
|
GetSelectedBuildMode(BuildMode);
|
||||||
|
|
||||||
NewSpeedButton.Enabled:=BuildModes<>nil;
|
NewSpeedButton.Enabled:=BuildModes<>nil;
|
||||||
DeleteSpeedButton.Enabled:=(ModesGrid.Row>=0);
|
|
||||||
MoveDownSpeedButton.Enabled:=(ModesGrid.Row>=0)
|
NewSpeedButton.Hint:='Create new build mode';
|
||||||
and (ModesGrid.Row<ModesGrid.RowCount-1);
|
if BuildMode<>nil then begin
|
||||||
MoveUpSpeedButton.Enabled:=(ModesGrid.Row>0);
|
DeleteSpeedButton.Enabled:=true;
|
||||||
|
MoveDownSpeedButton.Enabled:=(ModesGrid.Row<ModesGrid.RowCount-1);
|
||||||
|
MoveUpSpeedButton.Enabled:=(ModesGrid.Row>0);
|
||||||
|
DeleteSpeedButton.Hint:='Delete '+BuildMode.Identifier;
|
||||||
|
MoveDownSpeedButton.Hint:='Move '+BuildMode.Identifier+' down';
|
||||||
|
MoveUpSpeedButton.Hint:='Move '+BuildMode.Identifier+' up';
|
||||||
|
end else begin
|
||||||
|
DeleteSpeedButton.Enabled:=false;
|
||||||
|
MoveDownSpeedButton.Enabled:=false;
|
||||||
|
MoveUpSpeedButton.Enabled:=false;
|
||||||
|
DeleteSpeedButton.Hint:='Delete ...';
|
||||||
|
MoveDownSpeedButton.Hint:='Move down';
|
||||||
|
MoveUpSpeedButton.Hint:='Move up';
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCompOptBuildModesFrame.GetSelectedBuildMode(
|
function TCompOptBuildModesFrame.GetSelectedBuildMode(
|
||||||
@ -196,7 +213,7 @@ function TCompOptBuildModesFrame.GetSelectedBuildMode(
|
|||||||
begin
|
begin
|
||||||
BuildMode:=nil;
|
BuildMode:=nil;
|
||||||
if BuildModes=nil then exit(false);
|
if BuildModes=nil then exit(false);
|
||||||
if ModesGrid.Row<0 then exit(false);
|
if (ModesGrid.Row<0) or (ModesGrid.Row>=BuildModes.Count) then exit(false);
|
||||||
BuildMode:=TIDEBuildMode(BuildModes.Items[ModesGrid.Row]);
|
BuildMode:=TIDEBuildMode(BuildModes.Items[ModesGrid.Row]);
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
@ -210,16 +227,12 @@ begin
|
|||||||
ModesGroupBox.Caption:='Build modes';
|
ModesGroupBox.Caption:='Build modes';
|
||||||
NewSpeedButton.LoadGlyphFromLazarusResource('menu_new');
|
NewSpeedButton.LoadGlyphFromLazarusResource('menu_new');
|
||||||
NewSpeedButton.ShowHint:=true;
|
NewSpeedButton.ShowHint:=true;
|
||||||
NewSpeedButton.Hint:='Create new build mode';
|
|
||||||
DeleteSpeedButton.LoadGlyphFromLazarusResource('menu_project_remove');
|
DeleteSpeedButton.LoadGlyphFromLazarusResource('menu_project_remove');
|
||||||
DeleteSpeedButton.ShowHint:=true;
|
DeleteSpeedButton.ShowHint:=true;
|
||||||
DeleteSpeedButton.Hint:='Delete ...';
|
|
||||||
MoveDownSpeedButton.LoadGlyphFromLazarusResource('arrow_down');
|
MoveDownSpeedButton.LoadGlyphFromLazarusResource('arrow_down');
|
||||||
MoveDownSpeedButton.ShowHint:=true;
|
MoveDownSpeedButton.ShowHint:=true;
|
||||||
MoveDownSpeedButton.Hint:='Move down';
|
|
||||||
MoveUpSpeedButton.LoadGlyphFromLazarusResource('arrow_up');
|
MoveUpSpeedButton.LoadGlyphFromLazarusResource('arrow_up');
|
||||||
MoveUpSpeedButton.ShowHint:=true;
|
MoveUpSpeedButton.ShowHint:=true;
|
||||||
MoveUpSpeedButton.Hint:='Move up';
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCompOptBuildModesFrame.Destroy;
|
destructor TCompOptBuildModesFrame.Destroy;
|
||||||
|
Loading…
Reference in New Issue
Block a user