mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 13:56:05 +02:00
IDE: build macros for projects
git-svn-id: trunk@27428 -
This commit is contained in:
parent
2c86da69b2
commit
c32c577831
@ -69,7 +69,6 @@
|
||||
- using conditionals to extend package usage paths: TParsedCompilerOptions.GetUnparsedWithConditionals
|
||||
|
||||
ToDo:
|
||||
- move the project target file to compiler options
|
||||
- conditionals for project
|
||||
- warn for macro name conflicts
|
||||
- keywords
|
||||
@ -81,6 +80,10 @@
|
||||
- show build macros in inherited compiler options
|
||||
- use syntax highlighter settings like the editor previews
|
||||
- show syntax errors of conditionals
|
||||
- code completion
|
||||
- move the project target file to compiler options
|
||||
- discuss captions
|
||||
- resourcestrings
|
||||
- a project can save the set of build macros and compiler options
|
||||
- add changestamp, assign, equals to compiler options
|
||||
- refactor compiler options (default options, load, save to file)
|
||||
|
@ -760,7 +760,6 @@ begin
|
||||
Checked[19] := Options.WriteFPCLogo;
|
||||
end;
|
||||
|
||||
|
||||
// compiler messages
|
||||
chkUseMsgFile.OnChange := nil;
|
||||
try
|
||||
@ -782,6 +781,7 @@ begin
|
||||
edtErrorCnt.Text := IntToStr(Options.StopAfterErrCount);
|
||||
|
||||
// conditionals + build macros
|
||||
debugln(['TfrmCompilerOptions.LoadOptionsToForm ']);
|
||||
{$IFDEF EnableBuildModes}
|
||||
BuildMacrosFrame.LoadFromOptions(Options);
|
||||
{$ENDIF}
|
||||
|
@ -31,7 +31,7 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, FileUtil, Controls, Forms, StdCtrls, Grids,
|
||||
Buttons, ExtCtrls, Dialogs, ComCtrls, Menus, AvgLvlTree, IDEImagesIntf,
|
||||
ProjectIntf, PackageIntf, CompilerOptions,
|
||||
ProjectIntf, PackageIntf, CompilerOptions, IDEOptionsIntf,
|
||||
LazarusIDEStrConsts, CompOptsModes, PackageDefs, SynEdit, SynHighlighterPas;
|
||||
|
||||
type
|
||||
@ -43,7 +43,7 @@ type
|
||||
|
||||
{ TCompOptBuildMacrosFrame }
|
||||
|
||||
TCompOptBuildMacrosFrame = class(TFrame)
|
||||
TCompOptBuildMacrosFrame = class(TAbstractIDEOptionsEditor)
|
||||
BuildMacroDescriptionEdit: TEdit;
|
||||
BuildMacroSelectedGroupBox: TGroupBox;
|
||||
BuildMacrosTreeView: TTreeView;
|
||||
@ -85,6 +85,11 @@ type
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
function GetTitle: String; override;
|
||||
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
|
||||
class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
|
||||
procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
|
||||
procedure WriteSettings(AOptions: TAbstractIDEOptions); override;
|
||||
property BuildMacros: TIDEBuildMacros read FBuildMacros write SetBuildMacros; // local copy
|
||||
procedure LoadFromOptions(Options: TBaseCompilerOptions);
|
||||
procedure SaveToOptions(Options: TBaseCompilerOptions);
|
||||
@ -443,6 +448,35 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TCompOptBuildMacrosFrame.GetTitle: String;
|
||||
begin
|
||||
Result:='Build macros';
|
||||
end;
|
||||
|
||||
procedure TCompOptBuildMacrosFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if AOptions is TBaseCompilerOptions then
|
||||
LoadFromOptions(TBaseCompilerOptions(AOptions));
|
||||
end;
|
||||
|
||||
procedure TCompOptBuildMacrosFrame.Setup(ADialog: TAbstractOptionsEditorDialog
|
||||
);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
class function TCompOptBuildMacrosFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;
|
||||
begin
|
||||
Result := TBaseCompilerOptions;
|
||||
end;
|
||||
|
||||
procedure TCompOptBuildMacrosFrame.WriteSettings(AOptions: TAbstractIDEOptions
|
||||
);
|
||||
begin
|
||||
if AOptions is TBaseCompilerOptions then
|
||||
SaveToOptions(TBaseCompilerOptions(AOptions));
|
||||
end;
|
||||
|
||||
procedure TCompOptBuildMacrosFrame.LoadFromOptions(Options: TBaseCompilerOptions
|
||||
);
|
||||
begin
|
||||
@ -458,5 +492,11 @@ begin
|
||||
Options.Conditionals:=CondSynEdit.Lines.Text;
|
||||
end;
|
||||
|
||||
{$IFDEF EnableBuildModes}
|
||||
initialization
|
||||
RegisterIDEOptionsEditor(GroupCompiler, TCompOptBuildMacrosFrame,
|
||||
CompilerOptionsConditional);
|
||||
{$ENDIF}
|
||||
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user