mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-10 07:10:12 +01:00
IDE: rescan fpc: update default targetos, targetcpu
git-svn-id: trunk@36350 -
This commit is contained in:
parent
ec018adf2d
commit
635c911aad
@ -732,6 +732,7 @@ type
|
|||||||
property ChangeStamp: integer read FChangeStamp;
|
property ChangeStamp: integer read FChangeStamp;
|
||||||
function Find(CompilerFilename, CompilerOptions, TargetOS, TargetCPU: string;
|
function Find(CompilerFilename, CompilerOptions, TargetOS, TargetCPU: string;
|
||||||
CreateIfNotExists: boolean): TFPCTargetConfigCache;
|
CreateIfNotExists: boolean): TFPCTargetConfigCache;
|
||||||
|
function GetListing: string;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TFPCSourceCaches = class;
|
TFPCSourceCaches = class;
|
||||||
@ -7075,18 +7076,18 @@ var
|
|||||||
begin
|
begin
|
||||||
Result:=true;
|
Result:=true;
|
||||||
if (not FileExistsCached(Compiler)) then begin
|
if (not FileExistsCached(Compiler)) then begin
|
||||||
debugln(['TFPCTargetConfigCache.NeedsUpdate compiler file missing "',Compiler,'"']);
|
debugln(['TFPCTargetConfigCache.NeedsUpdate TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" compiler file missing "',Compiler,'"']);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if (FileAgeCached(Compiler)<>CompilerDate) then begin
|
if (FileAgeCached(Compiler)<>CompilerDate) then begin
|
||||||
debugln(['TFPCTargetConfigCache.NeedsUpdate compiler file changed "',Compiler,'" FileAge=',FileAgeCached(Compiler),' StoredAge=',CompilerDate]);
|
debugln(['TFPCTargetConfigCache.NeedsUpdate TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" compiler file changed "',Compiler,'" FileAge=',FileAgeCached(Compiler),' StoredAge=',CompilerDate]);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if (RealCompiler<>'') and (CompareFilenames(RealCompiler,Compiler)<>0)
|
if (RealCompiler<>'') and (CompareFilenames(RealCompiler,Compiler)<>0)
|
||||||
then begin
|
then begin
|
||||||
if (not FileExistsCached(RealCompiler))
|
if (not FileExistsCached(RealCompiler))
|
||||||
or (FileAgeCached(RealCompiler)<>RealCompilerDate) then begin
|
or (FileAgeCached(RealCompiler)<>RealCompilerDate) then begin
|
||||||
debugln(['TFPCTargetConfigCache.NeedsUpdate real compiler file changed "',RealCompiler,'"']);
|
debugln(['TFPCTargetConfigCache.NeedsUpdate TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" real compiler file changed "',RealCompiler,'"']);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -7094,18 +7095,18 @@ begin
|
|||||||
// and that is the RealCompiler
|
// and that is the RealCompiler
|
||||||
AFilename:=FindRealCompilerInPath(TargetCPU,true);
|
AFilename:=FindRealCompilerInPath(TargetCPU,true);
|
||||||
if RealCompilerInPath<>AFilename then begin
|
if RealCompilerInPath<>AFilename then begin
|
||||||
debugln(['TFPCTargetConfigCache.NeedsUpdate real compiler in PATH changed from "',RealCompilerInPath,'" to "',AFilename,'"']);
|
debugln(['TFPCTargetConfigCache.NeedsUpdate TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" real compiler in PATH changed from "',RealCompilerInPath,'" to "',AFilename,'"']);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
for i:=0 to ConfigFiles.Count-1 do begin
|
for i:=0 to ConfigFiles.Count-1 do begin
|
||||||
Cfg:=ConfigFiles[i];
|
Cfg:=ConfigFiles[i];
|
||||||
if Cfg.Filename='' then continue;
|
if Cfg.Filename='' then continue;
|
||||||
if FileExistsCached(Cfg.Filename)<>Cfg.FileExists then begin
|
if FileExistsCached(Cfg.Filename)<>Cfg.FileExists then begin
|
||||||
debugln(['TFPCTargetConfigCache.NeedsUpdate config fileexists changed "',Cfg.Filename,'"']);
|
debugln(['TFPCTargetConfigCache.NeedsUpdate TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" config fileexists changed "',Cfg.Filename,'"']);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if Cfg.FileExists and (FileAgeCached(Cfg.Filename)<>Cfg.FileDate) then begin
|
if Cfg.FileExists and (FileAgeCached(Cfg.Filename)<>Cfg.FileDate) then begin
|
||||||
debugln(['TFPCTargetConfigCache.NeedsUpdate config file changed "',Cfg.Filename,'"']);
|
debugln(['TFPCTargetConfigCache.NeedsUpdate TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" config file changed "',Cfg.Filename,'"']);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -7466,6 +7467,26 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TFPCTargetConfigCaches.GetListing: string;
|
||||||
|
var
|
||||||
|
Node: TAVLTreeNode;
|
||||||
|
CfgCache: TFPCTargetConfigCache;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
Result:='TFPCTargetConfigCaches.GetListing Count='+dbgs(fItems.Count)+LineEnding;
|
||||||
|
i:=0;
|
||||||
|
for Node in fItems do begin
|
||||||
|
inc(i);
|
||||||
|
CfgCache:=TFPCTargetConfigCache(Node.Data);
|
||||||
|
Result+=' '+dbgs(i)+':'
|
||||||
|
+' TargetOS="'+CfgCache.TargetOS+'"'
|
||||||
|
+' TargetCPU="'+CfgCache.TargetCPU+'"'
|
||||||
|
+' Compiler="'+CfgCache.Compiler+'"'
|
||||||
|
+' CompilerOptions="'+CfgCache.CompilerOptions+'"'
|
||||||
|
+LineEnding;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TFPCConfigFileStateList }
|
{ TFPCConfigFileStateList }
|
||||||
|
|
||||||
function TFPCConfigFileStateList.GetItems(Index: integer): TFPCConfigFileState;
|
function TFPCConfigFileStateList.GetItems(Index: integer): TFPCConfigFileState;
|
||||||
|
|||||||
@ -669,6 +669,15 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if FileExistsCached(EnvironmentOptions.GetParsedCompilerFilename) then
|
||||||
|
begin
|
||||||
|
// first check the default targetos, targetcpu of the default compiler
|
||||||
|
UnitSetCache:=CodeToolBoss.FPCDefinesCache.FindUnitSet(
|
||||||
|
EnvironmentOptions.GetParsedCompilerFilename,'','','',FPCSrcDir,true);
|
||||||
|
UnitSetCache.GetConfigCache(true);
|
||||||
|
end;
|
||||||
|
|
||||||
|
// create a cache for the current project settings
|
||||||
UnitSetCache:=CodeToolBoss.FPCDefinesCache.FindUnitSet(
|
UnitSetCache:=CodeToolBoss.FPCDefinesCache.FindUnitSet(
|
||||||
CompilerFilename,TargetOS,TargetCPU,'',FPCSrcDir,true);
|
CompilerFilename,TargetOS,TargetCPU,'',FPCSrcDir,true);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user