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 GetTargetFileExt: 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 GetInheritedOption(Option: TInheritedCompilerOption;
RelativeToBaseDir: boolean;
@ -1931,21 +1932,37 @@ function TBaseCompilerOptions.GetInheritedOption(
Option: TInheritedCompilerOption; RelativeToBaseDir: boolean;
Parsed: TCompilerOptionsParseType): string;
var
OptionsList: TFPList;
AddOptionsList: TFPList; // list of TAdditionalCompilerOptions
p: TCompilerOptionsParseType;
s: String;
begin
if (fInheritedOptParseStamps<>CompilerParseStamp)
then begin
// update inherited options
ClearInheritedOptions;
OptionsList:=nil;
GetInheritedCompilerOptions(OptionsList);
if OptionsList<>nil then begin
AddOptionsList:=nil;
GetInheritedCompilerOptions(AddOptionsList);
if AddOptionsList<>nil then begin
for p:=Low(TCompilerOptionsParseType) to High(TCompilerOptionsParseType)
do begin
GatherInheritedOptions(OptionsList,p,fInheritedOptions[p]);
GatherInheritedOptions(AddOptionsList,p,fInheritedOptions[p]);
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;
fInheritedOptParseStamps:=CompilerParseStamp;
end;
@ -3863,10 +3880,7 @@ begin
// apply overrides
if not PlatformIndependent then begin
if Option=pcosCustomOptions then begin
if Assigned(OnAppendCustomOption) then
OnAppendCustomOption(Self,s,bmgtAll);
end else if Option=pcosOutputDir then begin
if Option=pcosOutputDir then begin
if Assigned(OnGetOutputDirectoryOverride) then
OnGetOutputDirectoryOverride(Self,s,bmgtAll);
end;

View File

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

View File

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