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