IDE: refactor loading compiler options for build modes.

git-svn-id: trunk@45625 -
This commit is contained in:
juha 2014-06-23 18:48:25 +00:00
parent 7f873f8ee6
commit f61ce110b2

View File

@ -684,6 +684,7 @@ type
procedure LoadMacroValues(const Path: string; CurMode: TProjectBuildMode);
procedure LoadAllMacroValues(const Path: string; Cnt: Integer);
procedure LoadOldFormat(const Path: string);
procedure SetActiveMode(const Path: string);
// Used by SaveToXMLConfig
procedure SaveMacroValuesAtOldPlace(const Path: string; aMode: TProjectBuildMode);
public
@ -7203,6 +7204,16 @@ begin
CurMode.CompilerOptions.LoadFromXMLConfig(FXMLConfig,CompOptsPath);
end;
procedure TProjectBuildModes.SetActiveMode(const Path: string);
var
CurMode: TProjectBuildMode;
begin
CurMode:=Find(FXMLConfig.GetValue(Path+'BuildModes/Active','default'));
if CurMode=nil then
CurMode:=Items[0];
LazProject.ActiveBuildMode:=CurMode;
end;
// LoadFromXMLConfig itself
procedure TProjectBuildModes.LoadFromXMLConfig(XMLConfig: TXMLConfig;
const Path: string; LoadData, LoadParts: boolean);
@ -7237,11 +7248,7 @@ begin
// load what matrix options are enabled in session build modes
LoadSessionEnabledNonSessionMatrixOptions(Path+'BuildModes/SessionEnabledMatrixOptions/');
// set active mode
CurMode:=Find(FXMLConfig.GetValue(Path+'BuildModes/Active','default'));
if CurMode=nil then
CurMode:=Items[0];
LazProject.ActiveBuildMode:=CurMode;
SetActiveMode(Path);
end;
// Methods for SaveToXMLConfig