mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-10 14:38:18 +02:00
lazbuild: store laz dir and comp path to accelerate next start
git-svn-id: trunk@36282 -
This commit is contained in:
parent
1c32c0e67a
commit
976213c27e
@ -926,7 +926,7 @@ procedure TEnvironmentOptions.CreateConfig;
|
|||||||
var
|
var
|
||||||
ConfFileName: string;
|
ConfFileName: string;
|
||||||
begin
|
begin
|
||||||
ConfFileName:=SetDirSeparators(GetPrimaryConfigPath+'/'+EnvOptsConfFileName);
|
ConfFileName:=TrimFilename(SetDirSeparators(GetPrimaryConfigPath+'/'+EnvOptsConfFileName));
|
||||||
CopySecondaryConfigFile(EnvOptsConfFileName);
|
CopySecondaryConfigFile(EnvOptsConfFileName);
|
||||||
if (not FileExistsUTF8(ConfFileName)) then begin
|
if (not FileExistsUTF8(ConfFileName)) then begin
|
||||||
//DebugLn('Note: environment config file not found - using defaults');
|
//DebugLn('Note: environment config file not found - using defaults');
|
||||||
|
@ -53,8 +53,10 @@ type
|
|||||||
FBuildModeOverride: String;
|
FBuildModeOverride: String;
|
||||||
FBuildRecursive: boolean;
|
FBuildRecursive: boolean;
|
||||||
fCompilerOverride: String;
|
fCompilerOverride: String;
|
||||||
|
fCompilerInCfg: string;
|
||||||
FCreateMakefile: boolean;
|
FCreateMakefile: boolean;
|
||||||
fLazarusDirOverride : String;
|
fLazarusDirOverride : String;
|
||||||
|
fLazarusDirInCfg: string;
|
||||||
fCPUOverride: String;
|
fCPUOverride: String;
|
||||||
fOSOverride: String;
|
fOSOverride: String;
|
||||||
FSkipDependencies: boolean;
|
FSkipDependencies: boolean;
|
||||||
@ -121,6 +123,7 @@ type
|
|||||||
procedure SetupCodetools;
|
procedure SetupCodetools;
|
||||||
procedure SetupPackageSystem;
|
procedure SetupPackageSystem;
|
||||||
procedure SetupDialogs;
|
procedure SetupDialogs;
|
||||||
|
procedure StoreBaseSettings;
|
||||||
function RepairedCheckOptions(Const ShortOptions : String;
|
function RepairedCheckOptions(Const ShortOptions : String;
|
||||||
Const Longopts : TStrings; Opts,NonOpts : TStrings) : String;
|
Const Longopts : TStrings; Opts,NonOpts : TStrings) : String;
|
||||||
public
|
public
|
||||||
@ -825,6 +828,8 @@ begin
|
|||||||
SetupOutputFilter;
|
SetupOutputFilter;
|
||||||
MainBuildBoss.SetupCompilerInterface;
|
MainBuildBoss.SetupCompilerInterface;
|
||||||
|
|
||||||
|
StoreBaseSettings;
|
||||||
|
|
||||||
// load static base packages
|
// load static base packages
|
||||||
PackageGraph.LoadStaticBasePackages;
|
PackageGraph.LoadStaticBasePackages;
|
||||||
|
|
||||||
@ -838,6 +843,9 @@ begin
|
|||||||
with EnvironmentOptions do begin
|
with EnvironmentOptions do begin
|
||||||
CreateConfig;
|
CreateConfig;
|
||||||
Load(false);
|
Load(false);
|
||||||
|
fCompilerInCfg:=CompilerFilename;
|
||||||
|
fLazarusDirInCfg:=LazarusDirectory;
|
||||||
|
|
||||||
if Application.HasOption('language') then begin
|
if Application.HasOption('language') then begin
|
||||||
debugln('TLazBuildApplication.Init overriding language with command line: ',
|
debugln('TLazBuildApplication.Init overriding language with command line: ',
|
||||||
Application.GetOptionValue('language'));
|
Application.GetOptionValue('language'));
|
||||||
@ -906,6 +914,39 @@ begin
|
|||||||
IDEQuestionDialog:=@OnIDEQuestionDialog;
|
IDEQuestionDialog:=@OnIDEQuestionDialog;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TLazBuildApplication.StoreBaseSettings;
|
||||||
|
var
|
||||||
|
StoreLazDir: Boolean;
|
||||||
|
StoreCompPath: Boolean;
|
||||||
|
Cfg: TXMLConfig;
|
||||||
|
begin
|
||||||
|
StoreLazDir:=(fLazarusDirInCfg='') and (EnvironmentOptions.LazarusDirectory<>'');
|
||||||
|
StoreCompPath:=(fCompilerInCfg='') and (EnvironmentOptions.CompilerFilename<>'');
|
||||||
|
if (not StoreLazDir) and (not StoreCompPath) then exit;
|
||||||
|
|
||||||
|
try
|
||||||
|
dbgout('storing');
|
||||||
|
if StoreLazDir then
|
||||||
|
dbgout(' Lazarus directory "',EnvironmentOptions.LazarusDirectory,'"');
|
||||||
|
if StoreCompPath then
|
||||||
|
dbgout(' Compiler path "',EnvironmentOptions.CompilerFilename,'"');
|
||||||
|
debugln(' in "',EnvironmentOptions.Filename,'"');
|
||||||
|
Cfg:=TXMLConfig.Create(EnvironmentOptions.Filename);
|
||||||
|
try
|
||||||
|
if StoreLazDir then
|
||||||
|
Cfg.SetValue('EnvironmentOptions/LazarusDirectory/Value',
|
||||||
|
EnvironmentOptions.LazarusDirectory);
|
||||||
|
if StoreCompPath then
|
||||||
|
Cfg.SetValue('EnvironmentOptions/CompilerFilename/Value',
|
||||||
|
EnvironmentOptions.CompilerFilename);
|
||||||
|
Cfg.Flush;
|
||||||
|
finally
|
||||||
|
Cfg.Free;
|
||||||
|
end;
|
||||||
|
except
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TLazBuildApplication.RepairedCheckOptions(const ShortOptions: String;
|
function TLazBuildApplication.RepairedCheckOptions(const ShortOptions: String;
|
||||||
const Longopts: TStrings; Opts, NonOpts: TStrings): String;
|
const Longopts: TStrings; Opts, NonOpts: TStrings): String;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user