IDE: added Active property for compiler options

git-svn-id: trunk@27594 -
This commit is contained in:
mattias 2010-10-06 20:57:15 +00:00
parent 5127d60e15
commit f0e93fedb8
4 changed files with 29 additions and 18 deletions

View File

@ -91,7 +91,13 @@
- history
ToDo:
- create Makefile: create a .compiled file and copy that after compile (delete before compile)
- remove TGlobalCompilerOptions
- create Makefile:
- create a special .compiled file
- makefile should delete the .compiled before compile
- makefile should copy the .compiled after compile
- a IDE created with make, without extra options should not recompile a
package with this special .compiled file
- writable package output directory: set it on load package
- make lazbuild lcl independent, independent of packages except one
- license gpl2
@ -439,8 +445,8 @@ type
TCompilerMessagesList = class
private
fItems : TFPList;
fHash : array of array of TCompilerMessageConfig;
fItems : TFPList;
fHash : array of array of TCompilerMessageConfig;
protected
fUsedMsgFile : string;
fUpdating : Integer;
@ -1138,7 +1144,8 @@ procedure TBaseCompilerOptions.SetConditionals(const AValue: string);
begin
if FConditionals=AValue then exit;
FConditionals:=AValue;
IncreaseBuildMacroChangeStamp;
if ParsedOpts.InvalidateParseOnChange then
IncreaseBuildMacroChangeStamp;
end;
procedure TBaseCompilerOptions.SetDefaultMakeOptionsFlags(
@ -1170,21 +1177,24 @@ procedure TBaseCompilerOptions.SetTargetCPU(const AValue: string);
begin
if fTargetCPU=AValue then exit;
fTargetCPU:=AValue;
IncreaseBuildMacroChangeStamp;
if ParsedOpts.InvalidateParseOnChange then
IncreaseBuildMacroChangeStamp;
end;
procedure TBaseCompilerOptions.SetTargetProc(const AValue: string);
begin
if fTargetProc=AValue then exit;
fTargetProc:=AValue;
IncreaseBuildMacroChangeStamp;
if ParsedOpts.InvalidateParseOnChange then
IncreaseBuildMacroChangeStamp;
end;
procedure TBaseCompilerOptions.SetTargetOS(const AValue: string);
begin
if fTargetOS=AValue then exit;
fTargetOS:=AValue;
IncreaseBuildMacroChangeStamp;
if ParsedOpts.InvalidateParseOnChange then
IncreaseBuildMacroChangeStamp;
end;
procedure TBaseCompilerOptions.SetTargetFilename(const AValue: String);

View File

@ -2457,6 +2457,7 @@ begin
FEditorInfoList := TUnitEditorInfoList.Create(nil);
FBookmarks := TProjectBookmarkList.Create;
CompilerOptions := TProjectCompilerOptions.Create(Self);
CompilerOptions.Active:=true;
CompilerOptions.ParsedOpts.InvalidateParseOnChange:=true;
FDefineTemplates:=TProjectDefineTemplates.Create(Self);
FFlags:=DefaultProjectFlags;
@ -5476,13 +5477,15 @@ end;
procedure TProjectCompilerOptions.SetTargetCPU(const AValue: string);
begin
inherited SetTargetCPU(AValue);
FGlobals.TargetCPU:=TargetCPU;
if Active then
FGlobals.TargetCPU:=TargetCPU;
end;
procedure TProjectCompilerOptions.SetTargetOS(const AValue: string);
begin
inherited SetTargetOS(AValue);
FGlobals.TargetOS:=TargetOS;
if Active then
FGlobals.TargetOS:=TargetOS;
end;
procedure TProjectCompilerOptions.SetCustomOptions(const AValue: string);
@ -5490,7 +5493,7 @@ begin
if CustomOptions=AValue then exit;
InvalidateOptions;
inherited SetCustomOptions(AValue);
if Project<>nil then
if Active and (Project<>nil) then
Project.DefineTemplates.CustomDefinesChanged;
end;
@ -5541,7 +5544,7 @@ begin
if UnitOutputDirectory=AValue then exit;
InvalidateOptions;
inherited SetUnitOutputDir(AValue);
if Project<>nil then
if Active and (Project<>nil) then
Project.DefineTemplates.OutputDirectoryChanged;
end;
@ -5573,12 +5576,7 @@ end;
function TProjectCompilerOptions.IsEqual(CompOpts: TBaseCompilerOptions
): boolean;
begin
Result:=false;
if not inherited IsEqual(CompOpts) then exit;
if CompOpts is TProjectCompilerOptions then begin
end;
Result:=true;
Result:=inherited IsEqual(CompOpts);
end;
procedure TProjectCompilerOptions.CreateDiff(CompOpts: TBaseCompilerOptions;
@ -5596,7 +5594,6 @@ end;
procedure TProjectCompilerOptions.InvalidateOptions;
begin
if (Project=nil) then exit;
// TODO: propagate change to all dependant projects
end;
function TProjectCompilerOptions.GetEffectiveLCLWidgetType: string;
@ -5609,6 +5606,7 @@ end;
procedure TProjectCompilerOptions.UpdateGlobals;
begin
if not Active then exit;
FGlobals.TargetCPU:=TargetCPU;
FGlobals.TargetOS:=TargetOS;
end;

View File

@ -121,6 +121,7 @@ type
TLazCompilerOptions = class(TAbstractIDEProjectOptions)
private
FActive: boolean;
FOnModified: TNotifyEvent;
fOwner: TObject;
protected
@ -236,6 +237,7 @@ type
public
constructor Create(const TheOwner: TObject); virtual;
public
property Active: boolean read FActive write FActive;
property Owner: TObject read fOwner write fOwner;
property Modified: boolean read FModified write SetModified;
property OnModified: TNotifyEvent read FOnModified write FOnModified;

View File

@ -2419,6 +2419,7 @@ begin
FMacros.MarkUnhandledMacros:=false;
FMacros.OnSubstitution:=@OnMacroListSubstitution;
FCompilerOptions:=TPkgCompilerOptions.Create(Self);
FCompilerOptions.Active:=true;
FCompilerOptions.ParsedOpts.InvalidateParseOnChange:=true;
FCompilerOptions.ParsedOpts.OnLocalSubstitute:=@SubstitutePkgMacros;
FCompilerOptions.DefaultMakeOptionsFlags:=[ccloNoLinkerOpts];