IDE: mode matrix: moved custom options addition to inherited options

git-svn-id: trunk@41605 -
This commit is contained in:
mattias 2013-06-08 21:36:00 +00:00
parent 4cd9929af6
commit c97765d2ce
3 changed files with 27 additions and 13 deletions

View File

@ -503,7 +503,8 @@ type
function CreateTargetFilename(const MainSourceFileName: string): string; virtual; function CreateTargetFilename(const MainSourceFileName: string): string; virtual;
function GetTargetFileExt: string; virtual; function GetTargetFileExt: string; virtual;
function GetTargetFilePrefix: string; virtual; function GetTargetFilePrefix: string; virtual;
procedure GetInheritedCompilerOptions(var OptionsList: TFPList); virtual; procedure GetInheritedCompilerOptions(var OptionsList: TFPList // list of TAdditionalCompilerOptions
); virtual;
function GetOwnerName: string; virtual; function GetOwnerName: string; virtual;
function GetInheritedOption(Option: TInheritedCompilerOption; function GetInheritedOption(Option: TInheritedCompilerOption;
RelativeToBaseDir: boolean; RelativeToBaseDir: boolean;
@ -1931,21 +1932,37 @@ function TBaseCompilerOptions.GetInheritedOption(
Option: TInheritedCompilerOption; RelativeToBaseDir: boolean; Option: TInheritedCompilerOption; RelativeToBaseDir: boolean;
Parsed: TCompilerOptionsParseType): string; Parsed: TCompilerOptionsParseType): string;
var var
OptionsList: TFPList; AddOptionsList: TFPList; // list of TAdditionalCompilerOptions
p: TCompilerOptionsParseType; p: TCompilerOptionsParseType;
s: String;
begin begin
if (fInheritedOptParseStamps<>CompilerParseStamp) if (fInheritedOptParseStamps<>CompilerParseStamp)
then begin then begin
// update inherited options // update inherited options
ClearInheritedOptions; ClearInheritedOptions;
OptionsList:=nil; AddOptionsList:=nil;
GetInheritedCompilerOptions(OptionsList); GetInheritedCompilerOptions(AddOptionsList);
if OptionsList<>nil then begin if AddOptionsList<>nil then begin
for p:=Low(TCompilerOptionsParseType) to High(TCompilerOptionsParseType) for p:=Low(TCompilerOptionsParseType) to High(TCompilerOptionsParseType)
do begin do begin
GatherInheritedOptions(OptionsList,p,fInheritedOptions[p]); GatherInheritedOptions(AddOptionsList,p,fInheritedOptions[p]);
end; end;
OptionsList.Free; AddOptionsList.Free;
end;
// add project additions
if (Option=icoCustomOptions) and Assigned(OnAppendCustomOption)
and (Parsed<>coptParsedPlatformIndependent) // platform independent includes project independent
then begin
s:='';
OnAppendCustomOption(Self,s,bmgtAll);
if (Parsed=coptParsed) and Assigned(ParsedOpts.OnLocalSubstitute) then
begin
//DebugLn(['TParsedCompilerOptions.DoParseOption local "',s,'" ...']);
s:=ParsedOpts.OnLocalSubstitute(s,false);
end;
s:=SpecialCharsToSpaces(s,true);
fInheritedOptions[Parsed][Option]:=
MergeCustomOptions(fInheritedOptions[Parsed][Option],s);
end; end;
fInheritedOptParseStamps:=CompilerParseStamp; fInheritedOptParseStamps:=CompilerParseStamp;
end; end;
@ -3863,10 +3880,7 @@ begin
// apply overrides // apply overrides
if not PlatformIndependent then begin if not PlatformIndependent then begin
if Option=pcosCustomOptions then begin if Option=pcosOutputDir then begin
if Assigned(OnAppendCustomOption) then
OnAppendCustomOption(Self,s,bmgtAll);
end else if Option=pcosOutputDir then begin
if Assigned(OnGetOutputDirectoryOverride) then if Assigned(OnGetOutputDirectoryOverride) then
OnGetOutputDirectoryOverride(Self,s,bmgtAll); OnGetOutputDirectoryOverride(Self,s,bmgtAll);
end; end;

View File

@ -67,9 +67,9 @@ type
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override; procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
procedure ReadSettings(AOptions: TAbstractIDEOptions); override; procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
procedure WriteSettings(AOptions: TAbstractIDEOptions); override; procedure WriteSettings(AOptions: TAbstractIDEOptions); override;
procedure UpdateInheritedTree(CompilerOpts: TBaseCompilerOptions);
class function SupportedOptionsClass: TAbstractIDEOptionsClass; override; class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
property LastOptions: TBaseCompilerOptions read FLastOptions; property LastOptions: TBaseCompilerOptions read FLastOptions;
procedure UpdateInheritedTree(CompilerOpts: TBaseCompilerOptions);
end; end;
implementation implementation

View File

@ -24,7 +24,7 @@
Options frame for build mode matrix options. Options frame for build mode matrix options.
ToDo: ToDo:
- update matrix, when deleting build mode - add checkbox Show build modes
- move inherited to show options - move inherited to show options
- move IDE macros only for package usage - move IDE macros only for package usage
- move conditionals to Other - move conditionals to Other