codetools: renamed TFPCConfigFileStateList TPCConfigFileStateList, TFPCTargetConfigCache TPCTargetConfigCache

git-svn-id: trunk@56779 -
This commit is contained in:
mattias 2017-12-18 17:03:02 +00:00
parent 31b7c27181
commit 0d058c9c07
21 changed files with 204 additions and 194 deletions

View File

@ -1113,7 +1113,7 @@ var
LazarusSrcDefines: TDefineTemplate; LazarusSrcDefines: TDefineTemplate;
CurFPCOptions: String; CurFPCOptions: String;
UnitSetCache: TFPCUnitSetCache; UnitSetCache: TFPCUnitSetCache;
//CfgCache: TFPCTargetConfigCache; //CfgCache: TPCTargetConfigCache;
procedure AddFPCOption(s: string); procedure AddFPCOption(s: string);
begin begin
@ -6360,7 +6360,7 @@ procedure TCodeToolManager.DirectoryCachePoolIterateFPCUnitsFromSet(
var var
Changed: boolean; Changed: boolean;
UnitSetCache: TFPCUnitSetCache; UnitSetCache: TFPCUnitSetCache;
aConfigCache: TFPCTargetConfigCache; aConfigCache: TPCTargetConfigCache;
Node: TAVLTreeNode; Node: TAVLTreeNode;
Item: PStringToStringItem; Item: PStringToStringItem;
begin begin
@ -6519,7 +6519,7 @@ end;
function FindIncFileInCfgCache(const Name: string; out ExpFilename: string): boolean; function FindIncFileInCfgCache(const Name: string; out ExpFilename: string): boolean;
var var
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
UnitSet: TFPCUnitSetCache; UnitSet: TFPCUnitSetCache;
begin begin
// search the include file in directories defines in fpc.cfg (by -Fi option) // search the include file in directories defines in fpc.cfg (by -Fi option)

View File

@ -83,7 +83,7 @@ type
TCodeToolsOptions = class TCodeToolsOptions = class
private private
FConfigCaches: TFPCTargetConfigCaches; FConfigCaches: TPCTargetConfigCaches;
FFPCOptions: string; FFPCOptions: string;
FFPCPath: string; FFPCPath: string;
FFPCSrcDir: string; FFPCSrcDir: string;
@ -138,7 +138,7 @@ type
property FPCUnitPath: string read FFPCUnitPath write SetFPCUnitPath; property FPCUnitPath: string read FFPCUnitPath write SetFPCUnitPath;
property PPUExt: string read FPPUExt write SetPPUExt; property PPUExt: string read FPPUExt write SetPPUExt;
property SourceCaches: TFPCSourceCaches read FSourceCaches; property SourceCaches: TFPCSourceCaches read FSourceCaches;
property ConfigCaches: TFPCTargetConfigCaches read FConfigCaches; property ConfigCaches: TPCTargetConfigCaches read FConfigCaches;
property UnitLinkListValid: boolean read FUnitLinkListValid write SetUnitLinkListValid; property UnitLinkListValid: boolean read FUnitLinkListValid write SetUnitLinkListValid;
property UnitLinkList: string read FUnitLinkList write SetUnitLinkList; property UnitLinkList: string read FUnitLinkList write SetUnitLinkList;
@ -277,7 +277,7 @@ constructor TCodeToolsOptions.Create;
begin begin
FPPUExt:='.ppu'; FPPUExt:='.ppu';
FLCLWidgetType:='gtk2'; FLCLWidgetType:='gtk2';
FConfigCaches:=TFPCTargetConfigCaches.Create(nil); FConfigCaches:=TPCTargetConfigCaches.Create(nil);
FSourceCaches:=TFPCSourceCaches.Create(nil); FSourceCaches:=TFPCSourceCaches.Create(nil);
end; end;

View File

@ -726,49 +726,53 @@ const
type type
{ TFPCConfigFileState { TPCConfigFileState
Store if a config file exists and its modification date } Store if a config file exists and its modification date }
TFPCConfigFileState = class TPCConfigFileState = class
public public
Filename: string; Filename: string;
FileExists: boolean; FileExists: boolean;
FileDate: longint; FileDate: longint;
constructor Create(const aFilename: string; constructor Create(const aFilename: string;
aFileExists: boolean; aFileDate: longint); aFileExists: boolean; aFileDate: longint);
function Equals(Other: TFPCConfigFileState; CheckDate: boolean): boolean; reintroduce; function Equals(Other: TPCConfigFileState; CheckDate: boolean): boolean; reintroduce;
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string); procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
end; end;
{ TFPCConfigFileStateList TFPCConfigFileState = TPCConfigFileState deprecated 'use TPCConfigFileState'; // Laz 1.9
list of TFPCConfigFileState }
TFPCConfigFileStateList = class { TPCConfigFileStateList
list of TPCConfigFileState }
TPCConfigFileStateList = class
private private
fItems: TFPList; fItems: TFPList;
function GetItems(Index: integer): TFPCConfigFileState; function GetItems(Index: integer): TPCConfigFileState;
public public
constructor Create; constructor Create;
destructor Destroy; override; destructor Destroy; override;
procedure Clear; procedure Clear;
procedure Assign(List: TFPCConfigFileStateList); procedure Assign(List: TPCConfigFileStateList);
function Equals(List: TFPCConfigFileStateList; CheckDates: boolean): boolean; reintroduce; function Equals(List: TPCConfigFileStateList; CheckDates: boolean): boolean; reintroduce;
function Add(aFilename: string; aFileExists: boolean; function Add(aFilename: string; aFileExists: boolean;
aFileDate: longint): TFPCConfigFileState; aFileDate: longint): TPCConfigFileState;
function Count: integer; function Count: integer;
property Items[Index: integer]: TFPCConfigFileState read GetItems; default; property Items[Index: integer]: TPCConfigFileState read GetItems; default;
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string); procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
end; end;
TFPCTargetConfigCaches = class; TFPCConfigFileStateList = TPCConfigFileStateList deprecated 'use TPCConfigFileStateList'; // Laz 1.9
{ TFPCTargetConfigCache TPCTargetConfigCaches = class;
{ TPCTargetConfigCache
Storing all information (macros, search paths) of one compiler Storing all information (macros, search paths) of one compiler
with one specific TargetOS and TargetCPU. } with one specific TargetOS and TargetCPU. }
TFPCTargetConfigCache = class(TComponent) TPCTargetConfigCache = class(TComponent)
private private
FChangeStamp: integer; FChangeStamp: integer;
public public
@ -778,6 +782,7 @@ type
Compiler: string; // full file name Compiler: string; // full file name
CompilerOptions: string; // e.g. -V<version> -Xp<path> CompilerOptions: string; // e.g. -V<version> -Xp<path>
// values // values
Kind: TPascalCompiler;
CompilerDate: longint; CompilerDate: longint;
RealCompiler: string; // when Compiler is fpc, this is the real compiler (e.g. ppc386) RealCompiler: string; // when Compiler is fpc, this is the real compiler (e.g. ppc386)
RealCompilerDate: longint; RealCompilerDate: longint;
@ -785,7 +790,7 @@ type
RealTargetCPU: string; RealTargetCPU: string;
RealCompilerInPath: string; // the ppc<target> in PATH RealCompilerInPath: string; // the ppc<target> in PATH
FullVersion: string; // Version.Release.Patch FullVersion: string; // Version.Release.Patch
ConfigFiles: TFPCConfigFileStateList; ConfigFiles: TPCConfigFileStateList;
UnitPaths: TStrings; UnitPaths: TStrings;
IncludePaths: TStrings; IncludePaths: TStrings;
Defines: TStringToStringTree; // macro to value Defines: TStringToStringTree; // macro to value
@ -794,12 +799,12 @@ type
Includes: TStringToStringTree; // inc name to file name Includes: TStringToStringTree; // inc name to file name
ErrorMsg: string; ErrorMsg: string;
ErrorTranslatedMsg: string; ErrorTranslatedMsg: string;
Caches: TFPCTargetConfigCaches; Caches: TPCTargetConfigCaches;
HasPPUs: boolean; HasPPUs: boolean;
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
procedure Clear; // values, not keys procedure Clear; // values, not keys
function Equals(Item: TFPCTargetConfigCache; function Equals(Item: TPCTargetConfigCache;
CompareKey: boolean = true): boolean; reintroduce; CompareKey: boolean = true): boolean; reintroduce;
procedure Assign(Source: TPersistent); override; procedure Assign(Source: TPersistent); override;
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string); procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
@ -820,20 +825,22 @@ type
property ChangeStamp: integer read FChangeStamp; property ChangeStamp: integer read FChangeStamp;
end; end;
{ TFPCTargetConfigCaches TFPCTargetConfigCache = TPCTargetConfigCache deprecated 'use TPCTargetConfigCache'; // Laz 1.9
List of TFPCTargetConfigCache }
TFPCTargetConfigCaches = class(TComponent) { TPCTargetConfigCaches
List of TPCTargetConfigCache }
TPCTargetConfigCaches = class(TComponent)
private private
FChangeStamp: integer; FChangeStamp: integer;
FExtraOptions: string; FExtraOptions: string;
fItems: TAVLTree; // tree of TFPCTargetConfigCache fItems: TAVLTree; // tree of TPCTargetConfigCache
FTestFilename: string; FTestFilename: string;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
procedure Clear; procedure Clear;
function Equals(Caches: TFPCTargetConfigCaches): boolean; reintroduce; function Equals(Caches: TPCTargetConfigCaches): boolean; reintroduce;
procedure Assign(Source: TPersistent); override; procedure Assign(Source: TPersistent); override;
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string); procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
@ -842,7 +849,7 @@ type
procedure IncreaseChangeStamp; procedure IncreaseChangeStamp;
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): TPCTargetConfigCache;
procedure GetDefaultCompilerTarget(const CompilerFilename,CompilerOptions: string; procedure GetDefaultCompilerTarget(const CompilerFilename,CompilerOptions: string;
out TargetOS, TargetCPU: string); out TargetOS, TargetCPU: string);
function GetListing: string; function GetListing: string;
@ -850,6 +857,8 @@ type
property ExtraOptions: string read FExtraOptions write FExtraOptions; // additional compiler options not used as key, e.g. -Fr<language file> property ExtraOptions: string read FExtraOptions write FExtraOptions; // additional compiler options not used as key, e.g. -Fr<language file>
end; end;
TFPCTargetConfigCaches = TPCTargetConfigCaches deprecated 'use TPCTargetConfigCaches'; // Laz 1.9
TFPCSourceCaches = class; TFPCSourceCaches = class;
{ TFPCSourceCache { TFPCSourceCache
@ -921,7 +930,7 @@ type
FFPCSourceDirectory: string; FFPCSourceDirectory: string;
FTargetCPU: string; FTargetCPU: string;
FTargetOS: string; FTargetOS: string;
FConfigCache: TFPCTargetConfigCache; FConfigCache: TPCTargetConfigCache;
fSourceCache: TFPCSourceCache; fSourceCache: TFPCSourceCache;
fSourceRules: TFPCSourceRules; fSourceRules: TFPCSourceRules;
fRulesStampOfConfig: integer; // fSourceCache.ChangeStamp while creation of fFPCSourceRules fRulesStampOfConfig: integer; // fSourceCache.ChangeStamp while creation of fFPCSourceRules
@ -952,7 +961,7 @@ type
property TargetOS: string read FTargetOS write SetTargetOS; // case insensitive, will be passed lowercase property TargetOS: string read FTargetOS write SetTargetOS; // case insensitive, will be passed lowercase
property TargetCPU: string read FTargetCPU write SetTargetCPU; // case insensitive, will be passed lowercase property TargetCPU: string read FTargetCPU write SetTargetCPU; // case insensitive, will be passed lowercase
property FPCSourceDirectory: string read FFPCSourceDirectory write SetFPCSourceDirectory; property FPCSourceDirectory: string read FFPCSourceDirectory write SetFPCSourceDirectory;
function GetConfigCache(AutoUpdate: boolean): TFPCTargetConfigCache; function GetConfigCache(AutoUpdate: boolean): TPCTargetConfigCache;
function GetSourceCache(AutoUpdate: boolean): TFPCSourceCache; function GetSourceCache(AutoUpdate: boolean): TFPCSourceCache;
function GetSourceRules(AutoUpdate: boolean): TFPCSourceRules; function GetSourceRules(AutoUpdate: boolean): TFPCSourceRules;
function GetUnitToSourceTree(AutoUpdate: boolean): TStringToStringTree; // unit name to file name (maybe relative) function GetUnitToSourceTree(AutoUpdate: boolean): TStringToStringTree; // unit name to file name (maybe relative)
@ -972,14 +981,14 @@ type
TCompilerDefinesCache = class(TComponent) TCompilerDefinesCache = class(TComponent)
private private
FConfigCaches: TFPCTargetConfigCaches; FConfigCaches: TPCTargetConfigCaches;
FConfigCachesSaveStamp: integer; FConfigCachesSaveStamp: integer;
FSourceCaches: TFPCSourceCaches; FSourceCaches: TFPCSourceCaches;
FSourceCachesSaveStamp: integer; FSourceCachesSaveStamp: integer;
fUnitToSrcCaches: TFPList; // list of TFPCUnitSetCache fUnitToSrcCaches: TFPList; // list of TFPCUnitSetCache
function GetExtraOptions: string; function GetExtraOptions: string;
function GetTestFilename: string; function GetTestFilename: string;
procedure SetConfigCaches(const AValue: TFPCTargetConfigCaches); procedure SetConfigCaches(const AValue: TPCTargetConfigCaches);
procedure SetExtraOptions(AValue: string); procedure SetExtraOptions(AValue: string);
procedure SetSourceCaches(const AValue: TFPCSourceCaches); procedure SetSourceCaches(const AValue: TFPCSourceCaches);
procedure ClearUnitToSrcCaches; procedure ClearUnitToSrcCaches;
@ -994,7 +1003,7 @@ type
procedure SaveToFile(Filename: string); procedure SaveToFile(Filename: string);
function NeedsSave: boolean; function NeedsSave: boolean;
property SourceCaches: TFPCSourceCaches read FSourceCaches write SetSourceCaches; property SourceCaches: TFPCSourceCaches read FSourceCaches write SetSourceCaches;
property ConfigCaches: TFPCTargetConfigCaches read FConfigCaches write SetConfigCaches; property ConfigCaches: TPCTargetConfigCaches read FConfigCaches write SetConfigCaches;
property TestFilename: string read GetTestFilename write SetTestFilename; // an empty file to test the compiler, will be auto created property TestFilename: string read GetTestFilename write SetTestFilename; // an empty file to test the compiler, will be auto created
property ExtraOptions: string read GetExtraOptions write SetExtraOptions; // additional compiler options not used as key, e.g. -Fr<language file> property ExtraOptions: string read GetExtraOptions write SetExtraOptions; // additional compiler options not used as key, e.g. -Fr<language file>
function GetFPCVersion(const CompilerFilename, TargetOS, TargetCPU: string; function GetFPCVersion(const CompilerFilename, TargetOS, TargetCPU: string;
@ -1094,7 +1103,7 @@ function GatherUnitsInFPCSources(Files: TStringList;
Duplicates: TStringToStringTree = nil; // unit to semicolon separated list of files Duplicates: TStringToStringTree = nil; // unit to semicolon separated list of files
Rules: TFPCSourceRules = nil; Rules: TFPCSourceRules = nil;
const DebugUnitName: string = ''): TStringToStringTree; const DebugUnitName: string = ''): TStringToStringTree;
function CreateFPCTemplate(Config: TFPCTargetConfigCache; function CreateFPCTemplate(Config: TPCTargetConfigCache;
Owner: TObject): TDefineTemplate; overload; Owner: TObject): TDefineTemplate; overload;
function CreateFPCTemplate(Config: TFPCUnitSetCache; function CreateFPCTemplate(Config: TFPCUnitSetCache;
Owner: TObject): TDefineTemplate; overload; Owner: TObject): TDefineTemplate; overload;
@ -1107,9 +1116,9 @@ procedure CheckPPUSources(PPUFiles, // unitname to filename
UnitToDuplicates: TStringToStringTree; // unitname to semicolon separated list of files UnitToDuplicates: TStringToStringTree; // unitname to semicolon separated list of files
var Duplicates, Missing: TStringToStringTree); var Duplicates, Missing: TStringToStringTree);
procedure LoadFPCCacheFromFile(Filename: string; procedure LoadFPCCacheFromFile(Filename: string;
var Configs: TFPCTargetConfigCaches; var Sources: TFPCSourceCaches); var Configs: TPCTargetConfigCaches; var Sources: TFPCSourceCaches);
procedure SaveFPCCacheToFile(Filename: string; procedure SaveFPCCacheToFile(Filename: string;
Configs: TFPCTargetConfigCaches; Sources: TFPCSourceCaches); Configs: TPCTargetConfigCaches; Sources: TFPCSourceCaches);
// FPC // FPC
const const
@ -2206,7 +2215,7 @@ begin
end; end;
end; end;
function CreateFPCTemplate(Config: TFPCTargetConfigCache; Owner: TObject): TDefineTemplate; function CreateFPCTemplate(Config: TPCTargetConfigCache; Owner: TObject): TDefineTemplate;
var var
Node: TAVLTreeNode; Node: TAVLTreeNode;
StrItem: PStringToStringItem; StrItem: PStringToStringItem;
@ -2756,11 +2765,11 @@ begin
end; end;
procedure LoadFPCCacheFromFile(Filename: string; procedure LoadFPCCacheFromFile(Filename: string;
var Configs: TFPCTargetConfigCaches; var Sources: TFPCSourceCaches); var Configs: TPCTargetConfigCaches; var Sources: TFPCSourceCaches);
var var
XMLConfig: TXMLConfig; XMLConfig: TXMLConfig;
begin begin
if Configs=nil then Configs:=TFPCTargetConfigCaches.Create(nil); if Configs=nil then Configs:=TPCTargetConfigCaches.Create(nil);
if Sources=nil then Sources:=TFPCSourceCaches.Create(nil); if Sources=nil then Sources:=TFPCSourceCaches.Create(nil);
if not FileExistsUTF8(Filename) then exit; if not FileExistsUTF8(Filename) then exit;
XMLConfig:=TXMLConfig.Create(Filename); XMLConfig:=TXMLConfig.Create(Filename);
@ -2772,7 +2781,7 @@ begin
end; end;
end; end;
procedure SaveFPCCacheToFile(Filename: string; Configs: TFPCTargetConfigCaches; procedure SaveFPCCacheToFile(Filename: string; Configs: TPCTargetConfigCaches;
Sources: TFPCSourceCaches); Sources: TFPCSourceCaches);
var var
XMLConfig: TXMLConfig; XMLConfig: TXMLConfig;
@ -3338,8 +3347,8 @@ end;
function CompareFPCTargetConfigCacheItems(CacheItem1, CacheItem2: Pointer): integer; function CompareFPCTargetConfigCacheItems(CacheItem1, CacheItem2: Pointer): integer;
var var
Item1: TFPCTargetConfigCache absolute CacheItem1; Item1: TPCTargetConfigCache absolute CacheItem1;
Item2: TFPCTargetConfigCache absolute CacheItem2; Item2: TPCTargetConfigCache absolute CacheItem2;
begin begin
Result:=CompareStr(Item1.TargetOS,Item2.TargetOS); Result:=CompareStr(Item1.TargetOS,Item2.TargetOS);
if Result<>0 then exit; if Result<>0 then exit;
@ -8355,25 +8364,25 @@ begin
Targets:=Rule.Targets; Targets:=Rule.Targets;
end; end;
{ TFPCTargetConfigCacheItem } { TPCTargetConfigCache }
constructor TFPCTargetConfigCache.Create(AOwner: TComponent); constructor TPCTargetConfigCache.Create(AOwner: TComponent);
begin begin
CTIncreaseChangeStamp(FChangeStamp); // set to not 0 CTIncreaseChangeStamp(FChangeStamp); // set to not 0
inherited Create(AOwner); inherited Create(AOwner);
ConfigFiles:=TFPCConfigFileStateList.Create; ConfigFiles:=TPCConfigFileStateList.Create;
if Owner is TFPCTargetConfigCaches then if Owner is TPCTargetConfigCaches then
Caches:=TFPCTargetConfigCaches(Owner); Caches:=TPCTargetConfigCaches(Owner);
end; end;
destructor TFPCTargetConfigCache.Destroy; destructor TPCTargetConfigCache.Destroy;
begin begin
Clear; Clear;
FreeAndNil(ConfigFiles); FreeAndNil(ConfigFiles);
inherited Destroy; inherited Destroy;
end; end;
procedure TFPCTargetConfigCache.Clear; procedure TPCTargetConfigCache.Clear;
begin begin
// keep keys // keep keys
CompilerDate:=0; CompilerDate:=0;
@ -8395,7 +8404,7 @@ begin
FreeAndNil(Includes); FreeAndNil(Includes);
end; end;
function TFPCTargetConfigCache.Equals(Item: TFPCTargetConfigCache; function TPCTargetConfigCache.Equals(Item: TPCTargetConfigCache;
CompareKey: boolean): boolean; CompareKey: boolean): boolean;
function CompareStrings(List1, List2: TStrings): boolean; function CompareStrings(List1, List2: TStrings): boolean;
@ -8454,9 +8463,9 @@ begin
Result:=true; Result:=true;
end; end;
procedure TFPCTargetConfigCache.Assign(Source: TPersistent); procedure TPCTargetConfigCache.Assign(Source: TPersistent);
var var
Item: TFPCTargetConfigCache; Item: TPCTargetConfigCache;
procedure AssignStringTree(var Dest: TStringToStringTree; const Src: TStringToStringTree); procedure AssignStringTree(var Dest: TStringToStringTree; const Src: TStringToStringTree);
begin begin
@ -8479,8 +8488,8 @@ var
end; end;
begin begin
if Source is TFPCTargetConfigCache then begin if Source is TPCTargetConfigCache then begin
Item:=TFPCTargetConfigCache(Source); Item:=TPCTargetConfigCache(Source);
// keys // keys
TargetOS:=Item.TargetOS; TargetOS:=Item.TargetOS;
TargetCPU:=Item.TargetCPU; TargetCPU:=Item.TargetCPU;
@ -8510,7 +8519,7 @@ begin
inherited Assign(Source); inherited Assign(Source);
end; end;
procedure TFPCTargetConfigCache.LoadFromXMLConfig(XMLConfig: TXMLConfig; procedure TPCTargetConfigCache.LoadFromXMLConfig(XMLConfig: TXMLConfig;
const Path: string); const Path: string);
var var
Cnt: integer; Cnt: integer;
@ -8573,7 +8582,7 @@ var
Filename:=TrimFilename(FileList[i]); Filename:=TrimFilename(FileList[i]);
File_Name:=ExtractFileNameOnly(Filename); File_Name:=ExtractFileNameOnly(Filename);
if (File_Name='') or not IsDottedIdentifier(File_Name) then begin if (File_Name='') or not IsDottedIdentifier(File_Name) then begin
DebugLn(['Warning: [TFPCTargetConfigCache.LoadFromXMLConfig] invalid filename "',File_Name,'" in "',XMLConfig.Filename,'" at "',SubPath,'"']); DebugLn(['Warning: [TPCTargetConfigCache.LoadFromXMLConfig] invalid filename "',File_Name,'" in "',XMLConfig.Filename,'" at "',SubPath,'"']);
continue; continue;
end; end;
if ADest=nil then if ADest=nil then
@ -8609,7 +8618,7 @@ begin
SubPath:=Path+'Defines/Macro'+IntToStr(i)+'/'; SubPath:=Path+'Defines/Macro'+IntToStr(i)+'/';
DefineName:=UpperCaseStr(XMLConfig.GetValue(SubPath+'Name','')); DefineName:=UpperCaseStr(XMLConfig.GetValue(SubPath+'Name',''));
if not IsValidIdent(DefineName) then begin if not IsValidIdent(DefineName) then begin
DebugLn(['Warning: [TFPCTargetConfigCache.LoadFromXMLConfig] invalid define name ',DefineName]); DebugLn(['Warning: [TPCTargetConfigCache.LoadFromXMLConfig] invalid define name ',DefineName]);
continue; continue;
end; end;
DefineValue:=XMLConfig.GetValue(SubPath+'Value',''); DefineValue:=XMLConfig.GetValue(SubPath+'Value','');
@ -8644,7 +8653,7 @@ begin
LoadFilesFor(Includes,'Includes/'); LoadFilesFor(Includes,'Includes/');
end; end;
procedure TFPCTargetConfigCache.SaveToXMLConfig(XMLConfig: TXMLConfig; procedure TPCTargetConfigCache.SaveToXMLConfig(XMLConfig: TXMLConfig;
const Path: string); const Path: string);
var var
Node: TAVLTreeNode; Node: TAVLTreeNode;
@ -8775,7 +8784,7 @@ begin
SaveFilesFor(Includes, 'Includes/'); SaveFilesFor(Includes, 'Includes/');
end; end;
procedure TFPCTargetConfigCache.LoadFromFile(Filename: string); procedure TPCTargetConfigCache.LoadFromFile(Filename: string);
var var
XMLConfig: TXMLConfig; XMLConfig: TXMLConfig;
begin begin
@ -8787,7 +8796,7 @@ begin
end; end;
end; end;
procedure TFPCTargetConfigCache.SaveToFile(Filename: string); procedure TPCTargetConfigCache.SaveToFile(Filename: string);
var var
XMLConfig: TXMLConfig; XMLConfig: TXMLConfig;
begin begin
@ -8799,21 +8808,21 @@ begin
end; end;
end; end;
function TFPCTargetConfigCache.NeedsUpdate: boolean; function TPCTargetConfigCache.NeedsUpdate: boolean;
var var
i: Integer; i: Integer;
Cfg: TFPCConfigFileState; Cfg: TPCConfigFileState;
AFilename: String; AFilename: String;
begin begin
Result:=true; Result:=true;
if (not FileExistsCached(Compiler)) then begin if (not FileExistsCached(Compiler)) then begin
if CTConsoleVerbosity>0 then if CTConsoleVerbosity>0 then
debugln(['Hint: [TFPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" compiler file missing "',Compiler,'"']); debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" compiler file missing "',Compiler,'"']);
exit; exit;
end; end;
if (FileAgeCached(Compiler)<>CompilerDate) then begin if (FileAgeCached(Compiler)<>CompilerDate) then begin
if CTConsoleVerbosity>0 then if CTConsoleVerbosity>0 then
debugln(['Hint: [TFPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" compiler file changed "',Compiler,'" FileAge=',FileAgeCached(Compiler),' StoredAge=',CompilerDate]); debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" 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)
@ -8821,7 +8830,7 @@ begin
if (not FileExistsCached(RealCompiler)) if (not FileExistsCached(RealCompiler))
or (FileAgeCached(RealCompiler)<>RealCompilerDate) then begin or (FileAgeCached(RealCompiler)<>RealCompilerDate) then begin
if CTConsoleVerbosity>0 then if CTConsoleVerbosity>0 then
debugln(['Hint: [TFPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" real compiler file changed "',RealCompiler,'"']); debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" real compiler file changed "',RealCompiler,'"']);
exit; exit;
end; end;
end; end;
@ -8830,7 +8839,7 @@ begin
AFilename:=FindRealCompilerInPath(TargetCPU,true); AFilename:=FindRealCompilerInPath(TargetCPU,true);
if RealCompilerInPath<>AFilename then begin if RealCompilerInPath<>AFilename then begin
if CTConsoleVerbosity>0 then if CTConsoleVerbosity>0 then
debugln(['Hint: [TFPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" real compiler in PATH changed from "',RealCompilerInPath,'" to "',AFilename,'"']); debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" 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
@ -8838,19 +8847,19 @@ begin
if (Cfg.Filename='') or (not FilenameIsAbsolute(Cfg.Filename)) then continue; if (Cfg.Filename='') or (not FilenameIsAbsolute(Cfg.Filename)) then continue;
if FileExistsCached(Cfg.Filename)<>Cfg.FileExists then begin if FileExistsCached(Cfg.Filename)<>Cfg.FileExists then begin
if CTConsoleVerbosity>0 then if CTConsoleVerbosity>0 then
debugln(['Hint: [TFPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" config fileexists changed "',Cfg.Filename,'"']); debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" 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
if CTConsoleVerbosity>0 then if CTConsoleVerbosity>0 then
debugln(['Hint: [TFPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" config file changed "',Cfg.Filename,'"']); debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="',TargetOS,'" TargetCPU="',TargetCPU,'" Options="',CompilerOptions,'" config file changed "',Cfg.Filename,'"']);
exit; exit;
end; end;
end; end;
Result:=false; Result:=false;
end; end;
function TFPCTargetConfigCache.GetFPCInfoCmdLineOptions(ExtraOptions: string function TPCTargetConfigCache.GetFPCInfoCmdLineOptions(ExtraOptions: string
): string; ): string;
begin begin
Result:=CompilerOptions; Result:=CompilerOptions;
@ -8863,18 +8872,18 @@ begin
Result:=Trim(Result); Result:=Trim(Result);
end; end;
procedure TFPCTargetConfigCache.IncreaseChangeStamp; procedure TPCTargetConfigCache.IncreaseChangeStamp;
begin begin
CTIncreaseChangeStamp(FChangeStamp); CTIncreaseChangeStamp(FChangeStamp);
if Caches<>nil then if Caches<>nil then
Caches.IncreaseChangeStamp; Caches.IncreaseChangeStamp;
end; end;
function TFPCTargetConfigCache.Update(TestFilename: string; function TPCTargetConfigCache.Update(TestFilename: string;
ExtraOptions: string; const OnProgress: TDefinePoolProgress): boolean; ExtraOptions: string; const OnProgress: TDefinePoolProgress): boolean;
var var
i: Integer; i: Integer;
OldOptions: TFPCTargetConfigCache; OldOptions: TPCTargetConfigCache;
CfgFiles: TStrings; CfgFiles: TStrings;
Filename: string; Filename: string;
CfgFileExists: Boolean; CfgFileExists: Boolean;
@ -8895,7 +8904,7 @@ var
end; end;
begin begin
OldOptions:=TFPCTargetConfigCache.Create(nil); OldOptions:=TPCTargetConfigCache.Create(nil);
CfgFiles:=nil; CfgFiles:=nil;
try try
// remember old state to find out if something changed // remember old state to find out if something changed
@ -8903,7 +8912,7 @@ begin
Clear; Clear;
if CTConsoleVerbosity>0 then if CTConsoleVerbosity>0 then
debugln(['Hint: [TFPCTargetConfigCache.NeedsUpdate] ',Compiler,' TargetOS=',TargetOS,' TargetCPU=',TargetCPU,' CompilerOptions=',CompilerOptions,' ExtraOptions=',ExtraOptions,' PATH=',GetEnvironmentVariableUTF8('PATH')]); debugln(['Hint: [TPCTargetConfigCache.NeedsUpdate] ',Compiler,' TargetOS=',TargetOS,' TargetCPU=',TargetCPU,' CompilerOptions=',CompilerOptions,' ExtraOptions=',ExtraOptions,' PATH=',GetEnvironmentVariableUTF8('PATH')]);
CompilerDate:=FileAgeCached(Compiler); CompilerDate:=FileAgeCached(Compiler);
if FileExistsCached(Compiler) then begin if FileExistsCached(Compiler) then begin
ExtraOptions:=GetFPCInfoCmdLineOptions(ExtraOptions); ExtraOptions:=GetFPCInfoCmdLineOptions(ExtraOptions);
@ -8937,7 +8946,7 @@ begin
RealCompilerDate:=FileAgeCached(RealCompiler); RealCompilerDate:=FileAgeCached(RealCompiler);
end else begin end else begin
if CTConsoleVerbosity>=-1 then if CTConsoleVerbosity>=-1 then
debugln(['Warning: [TFPCTargetConfigCache.Update] invalid compiler: Compiler="'+Compiler+'" Options="'+ExtraOptions+'" RealCompiler="',RealCompiler,'"']); debugln(['Warning: [TPCTargetConfigCache.Update] invalid compiler: Compiler="'+Compiler+'" Options="'+ExtraOptions+'" RealCompiler="',RealCompiler,'"']);
end; end;
// store the list of tried and read cfg files // store the list of tried and read cfg files
if CfgFiles<>nil then if CfgFiles<>nil then
@ -8948,7 +8957,7 @@ begin
Filename:=copy(Filename,2,length(Filename)); Filename:=copy(Filename,2,length(Filename));
FullFilename:=ExpandFileNameUTF8(TrimFileName(Filename),BaseDir); FullFilename:=ExpandFileNameUTF8(TrimFileName(Filename),BaseDir);
if CfgFileExists<>FileExistsCached(FullFilename) then begin if CfgFileExists<>FileExistsCached(FullFilename) then begin
debugln(['Warning: [TFPCTargetConfigCache.Update] fpc found cfg a file, the IDE did not: "',Filename,'"']); debugln(['Warning: [TPCTargetConfigCache.Update] fpc found cfg a file, the IDE did not: "',Filename,'"']);
CfgFileExists:=not CfgFileExists; CfgFileExists:=not CfgFileExists;
end; end;
CfgFileDate:=0; CfgFileDate:=0;
@ -8960,7 +8969,7 @@ begin
GatherUnitsInSearchPaths(UnitPaths,IncludePaths,OnProgress,Units,Includes,true); GatherUnitsInSearchPaths(UnitPaths,IncludePaths,OnProgress,Units,Includes,true);
if (UnitPaths.Count=0) then begin if (UnitPaths.Count=0) then begin
if CTConsoleVerbosity>=-1 then if CTConsoleVerbosity>=-1 then
debugln(['Warning: [TFPCTargetConfigCache.Update] no unit paths: ',Compiler,' ',ExtraOptions]); debugln(['Warning: [TPCTargetConfigCache.Update] no unit paths: ',Compiler,' ',ExtraOptions]);
end; end;
// check if the system ppu exists // check if the system ppu exists
HasPPUs:=CompareFileExt(Units['system'],'ppu',false)=0; HasPPUs:=CompareFileExt(Units['system'],'ppu',false)=0;
@ -8969,7 +8978,7 @@ begin
if not Equals(OldOptions) then begin if not Equals(OldOptions) then begin
IncreaseChangeStamp; IncreaseChangeStamp;
if CTConsoleVerbosity>=0 then if CTConsoleVerbosity>=0 then
debugln(['Hint: [TFPCTargetConfigCache.Update] has changed']); debugln(['Hint: [TPCTargetConfigCache.Update] has changed']);
end; end;
Result:=true; Result:=true;
finally finally
@ -8978,7 +8987,7 @@ begin
end; end;
end; end;
function TFPCTargetConfigCache.FindRealCompilerInPath(aTargetCPU: string; function TPCTargetConfigCache.FindRealCompilerInPath(aTargetCPU: string;
ResolveLinks: boolean): string; ResolveLinks: boolean): string;
function Search(const ShortFileName: string): string; function Search(const ShortFileName: string): string;
@ -9039,7 +9048,7 @@ begin
end; end;
end; end;
function TFPCTargetConfigCache.GetUnitPaths: string; function TPCTargetConfigCache.GetUnitPaths: string;
begin begin
if UnitPaths=nil then exit(''); if UnitPaths=nil then exit('');
UnitPaths.Delimiter:=';'; UnitPaths.Delimiter:=';';
@ -9047,7 +9056,7 @@ begin
Result:=UnitPaths.DelimitedText; Result:=UnitPaths.DelimitedText;
end; end;
function TFPCTargetConfigCache.GetFPCVerNumbers(out FPCVersion, FPCRelease, function TPCTargetConfigCache.GetFPCVerNumbers(out FPCVersion, FPCRelease,
FPCPatch: integer): boolean; FPCPatch: integer): boolean;
var var
v: string; v: string;
@ -9061,7 +9070,7 @@ begin
end; end;
end; end;
function TFPCTargetConfigCache.GetFPCVer: string; function TPCTargetConfigCache.GetFPCVer: string;
var var
FPCVersion: integer; FPCVersion: integer;
FPCRelease: integer; FPCRelease: integer;
@ -9073,7 +9082,7 @@ begin
Result:=''; Result:='';
end; end;
function TFPCTargetConfigCache.GetFPC_FULLVERSION: integer; function TPCTargetConfigCache.GetFPC_FULLVERSION: integer;
begin begin
if Defines<>nil then if Defines<>nil then
Result:=StrToIntDef(Defines['FPC_FULLVERSION'],0) Result:=StrToIntDef(Defines['FPC_FULLVERSION'],0)
@ -9083,7 +9092,7 @@ begin
Result:=GetCompiledFPCVersion; Result:=GetCompiledFPCVersion;
end; end;
function TFPCTargetConfigCache.IndexOfUsedCfgFile: integer; function TPCTargetConfigCache.IndexOfUsedCfgFile: integer;
begin begin
if ConfigFiles=nil then exit(-1); if ConfigFiles=nil then exit(-1);
Result:=0; Result:=0;
@ -9092,42 +9101,42 @@ begin
if Result=ConfigFiles.Count then Result:=-1; if Result=ConfigFiles.Count then Result:=-1;
end; end;
{ TFPCTargetConfigCaches } { TPCTargetConfigCaches }
constructor TFPCTargetConfigCaches.Create(AOwner: TComponent); constructor TPCTargetConfigCaches.Create(AOwner: TComponent);
begin begin
CTIncreaseChangeStamp(FChangeStamp); // set to not 0 CTIncreaseChangeStamp(FChangeStamp); // set to not 0
inherited Create(AOwner); inherited Create(AOwner);
fItems:=TAVLTree.Create(@CompareFPCTargetConfigCacheItems); fItems:=TAVLTree.Create(@CompareFPCTargetConfigCacheItems);
end; end;
destructor TFPCTargetConfigCaches.Destroy; destructor TPCTargetConfigCaches.Destroy;
begin begin
Clear; Clear;
FreeAndNil(fItems); FreeAndNil(fItems);
inherited Destroy; inherited Destroy;
end; end;
procedure TFPCTargetConfigCaches.Clear; procedure TPCTargetConfigCaches.Clear;
begin begin
if fItems.Count=0 then exit; if fItems.Count=0 then exit;
fItems.FreeAndClear; fItems.FreeAndClear;
IncreaseChangeStamp; IncreaseChangeStamp;
end; end;
function TFPCTargetConfigCaches.Equals(Caches: TFPCTargetConfigCaches): boolean; function TPCTargetConfigCaches.Equals(Caches: TPCTargetConfigCaches): boolean;
var var
Node1, Node2: TAVLTreeNode; Node1, Node2: TAVLTreeNode;
Item1: TFPCTargetConfigCache; Item1: TPCTargetConfigCache;
Item2: TFPCTargetConfigCache; Item2: TPCTargetConfigCache;
begin begin
Result:=false; Result:=false;
if Caches.fItems.Count<>fItems.Count then exit; if Caches.fItems.Count<>fItems.Count then exit;
Node1:=fItems.FindLowest; Node1:=fItems.FindLowest;
Node2:=Caches.fItems.FindLowest; Node2:=Caches.fItems.FindLowest;
while Node1<>nil do begin while Node1<>nil do begin
Item1:=TFPCTargetConfigCache(Node1.Data); Item1:=TPCTargetConfigCache(Node1.Data);
Item2:=TFPCTargetConfigCache(Node2.Data); Item2:=TPCTargetConfigCache(Node2.Data);
if not Item1.Equals(Item2) then exit; if not Item1.Equals(Item2) then exit;
Node1:=fItems.FindSuccessor(Node1); Node1:=fItems.FindSuccessor(Node1);
Node2:=Caches.fItems.FindSuccessor(Node2); Node2:=Caches.fItems.FindSuccessor(Node2);
@ -9135,21 +9144,21 @@ begin
Result:=true; Result:=true;
end; end;
procedure TFPCTargetConfigCaches.Assign(Source: TPersistent); procedure TPCTargetConfigCaches.Assign(Source: TPersistent);
var var
Caches: TFPCTargetConfigCaches; Caches: TPCTargetConfigCaches;
Node: TAVLTreeNode; Node: TAVLTreeNode;
SrcItem: TFPCTargetConfigCache; SrcItem: TPCTargetConfigCache;
NewItem: TFPCTargetConfigCache; NewItem: TPCTargetConfigCache;
begin begin
if Source is TFPCTargetConfigCaches then begin if Source is TPCTargetConfigCaches then begin
Caches:=TFPCTargetConfigCaches(Source); Caches:=TPCTargetConfigCaches(Source);
if Equals(Caches) then exit; // no change, keep ChangeStamp if Equals(Caches) then exit; // no change, keep ChangeStamp
Clear; Clear;
Node:=Caches.fItems.FindLowest; Node:=Caches.fItems.FindLowest;
while Node<>nil do begin while Node<>nil do begin
SrcItem:=TFPCTargetConfigCache(Node.Data); SrcItem:=TPCTargetConfigCache(Node.Data);
NewItem:=TFPCTargetConfigCache.Create(Self); NewItem:=TPCTargetConfigCache.Create(Self);
NewItem.Assign(SrcItem); NewItem.Assign(SrcItem);
fItems.Add(NewItem); fItems.Add(NewItem);
Node:=Caches.fItems.FindSuccessor(Node); Node:=Caches.fItems.FindSuccessor(Node);
@ -9159,17 +9168,17 @@ begin
inherited Assign(Source); inherited Assign(Source);
end; end;
procedure TFPCTargetConfigCaches.LoadFromXMLConfig(XMLConfig: TXMLConfig; procedure TPCTargetConfigCaches.LoadFromXMLConfig(XMLConfig: TXMLConfig;
const Path: string); const Path: string);
var var
Cnt: integer; Cnt: integer;
i: Integer; i: Integer;
Item: TFPCTargetConfigCache; Item: TPCTargetConfigCache;
begin begin
Clear; Clear;
Cnt:=XMLConfig.GetValue(Path+'Count',0); Cnt:=XMLConfig.GetValue(Path+'Count',0);
for i:=1 to Cnt do begin for i:=1 to Cnt do begin
Item:=TFPCTargetConfigCache.Create(Self); Item:=TPCTargetConfigCache.Create(Self);
Item.LoadFromXMLConfig(XMLConfig,Path+'Item'+IntToStr(i)+'/'); Item.LoadFromXMLConfig(XMLConfig,Path+'Item'+IntToStr(i)+'/');
if (Item.Compiler<>'') then if (Item.Compiler<>'') then
fItems.Add(Item) fItems.Add(Item)
@ -9179,17 +9188,17 @@ begin
IncreaseChangeStamp; IncreaseChangeStamp;
end; end;
procedure TFPCTargetConfigCaches.SaveToXMLConfig(XMLConfig: TXMLConfig; procedure TPCTargetConfigCaches.SaveToXMLConfig(XMLConfig: TXMLConfig;
const Path: string); const Path: string);
var var
Node: TAVLTreeNode; Node: TAVLTreeNode;
Item: TFPCTargetConfigCache; Item: TPCTargetConfigCache;
i: Integer; i: Integer;
begin begin
Node:=fItems.FindLowest; Node:=fItems.FindLowest;
i:=0; i:=0;
while Node<>nil do begin while Node<>nil do begin
Item:=TFPCTargetConfigCache(Node.Data); Item:=TPCTargetConfigCache(Node.Data);
inc(i); inc(i);
Item.SaveToXMLConfig(XMLConfig,Path+'Item'+IntToStr(i)+'/'); Item.SaveToXMLConfig(XMLConfig,Path+'Item'+IntToStr(i)+'/');
Node:=fItems.FindSuccessor(Node); Node:=fItems.FindSuccessor(Node);
@ -9197,7 +9206,7 @@ begin
XMLConfig.SetDeleteValue(Path+'Count',i,0); XMLConfig.SetDeleteValue(Path+'Count',i,0);
end; end;
procedure TFPCTargetConfigCaches.LoadFromFile(Filename: string); procedure TPCTargetConfigCaches.LoadFromFile(Filename: string);
var var
XMLConfig: TXMLConfig; XMLConfig: TXMLConfig;
begin begin
@ -9209,7 +9218,7 @@ begin
end; end;
end; end;
procedure TFPCTargetConfigCaches.SaveToFile(Filename: string); procedure TPCTargetConfigCaches.SaveToFile(Filename: string);
var var
XMLConfig: TXMLConfig; XMLConfig: TXMLConfig;
begin begin
@ -9221,19 +9230,19 @@ begin
end; end;
end; end;
procedure TFPCTargetConfigCaches.IncreaseChangeStamp; procedure TPCTargetConfigCaches.IncreaseChangeStamp;
begin begin
CTIncreaseChangeStamp(FChangeStamp); CTIncreaseChangeStamp(FChangeStamp);
end; end;
function TFPCTargetConfigCaches.Find(CompilerFilename, CompilerOptions, function TPCTargetConfigCaches.Find(CompilerFilename, CompilerOptions,
TargetOS, TargetCPU: string; CreateIfNotExists: boolean TargetOS, TargetCPU: string; CreateIfNotExists: boolean
): TFPCTargetConfigCache; ): TPCTargetConfigCache;
var var
Node: TAVLTreeNode; Node: TAVLTreeNode;
Cmp: TFPCTargetConfigCache; Cmp: TPCTargetConfigCache;
begin begin
Cmp:=TFPCTargetConfigCache.Create(Self); Cmp:=TPCTargetConfigCache.Create(Self);
try try
Cmp.Compiler:=CompilerFilename; Cmp.Compiler:=CompilerFilename;
Cmp.CompilerOptions:=CompilerOptions; Cmp.CompilerOptions:=CompilerOptions;
@ -9241,7 +9250,7 @@ begin
Cmp.TargetCPU:=TargetCPU; Cmp.TargetCPU:=TargetCPU;
Node:=fItems.Find(cmp); Node:=fItems.Find(cmp);
if Node<>nil then begin if Node<>nil then begin
Result:=TFPCTargetConfigCache(Node.Data); Result:=TPCTargetConfigCache(Node.Data);
end else if CreateIfNotExists then begin end else if CreateIfNotExists then begin
Result:=cmp; Result:=cmp;
cmp:=nil; cmp:=nil;
@ -9254,11 +9263,11 @@ begin
end; end;
end; end;
procedure TFPCTargetConfigCaches.GetDefaultCompilerTarget( procedure TPCTargetConfigCaches.GetDefaultCompilerTarget(
const CompilerFilename, CompilerOptions: string; out TargetOS, const CompilerFilename, CompilerOptions: string; out TargetOS,
TargetCPU: string); TargetCPU: string);
var var
Cfg: TFPCTargetConfigCache; Cfg: TPCTargetConfigCache;
begin begin
Cfg:=Find(CompilerFilename,CompilerOptions,'','',true); Cfg:=Find(CompilerFilename,CompilerOptions,'','',true);
if Cfg=nil then begin if Cfg=nil then begin
@ -9272,18 +9281,18 @@ begin
end; end;
end; end;
function TFPCTargetConfigCaches.GetListing: string; function TPCTargetConfigCaches.GetListing: string;
var var
Node: TAVLTreeNode; Node: TAVLTreeNode;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
i: Integer; i: Integer;
begin begin
Result:='TFPCTargetConfigCaches.GetListing Count='+dbgs(fItems.Count)+LineEnding; Result:='TPCTargetConfigCaches.GetListing Count='+dbgs(fItems.Count)+LineEnding;
i:=0; i:=0;
Node:=fItems.FindLowest; Node:=fItems.FindLowest;
while Node<>nil do begin while Node<>nil do begin
inc(i); inc(i);
CfgCache:=TFPCTargetConfigCache(Node.Data); CfgCache:=TPCTargetConfigCache(Node.Data);
Result+=' '+dbgs(i)+':' Result+=' '+dbgs(i)+':'
+' TargetOS="'+CfgCache.TargetOS+'"' +' TargetOS="'+CfgCache.TargetOS+'"'
+' TargetCPU="'+CfgCache.TargetCPU+'"' +' TargetCPU="'+CfgCache.TargetCPU+'"'
@ -9294,26 +9303,26 @@ begin
end; end;
end; end;
{ TFPCConfigFileStateList } { TPCConfigFileStateList }
function TFPCConfigFileStateList.GetItems(Index: integer): TFPCConfigFileState; function TPCConfigFileStateList.GetItems(Index: integer): TPCConfigFileState;
begin begin
Result:=TFPCConfigFileState(fItems[Index]); Result:=TPCConfigFileState(fItems[Index]);
end; end;
constructor TFPCConfigFileStateList.Create; constructor TPCConfigFileStateList.Create;
begin begin
fItems:=TFPList.Create; fItems:=TFPList.Create;
end; end;
destructor TFPCConfigFileStateList.Destroy; destructor TPCConfigFileStateList.Destroy;
begin begin
Clear; Clear;
FreeAndNil(fItems); FreeAndNil(fItems);
inherited Destroy; inherited Destroy;
end; end;
procedure TFPCConfigFileStateList.Clear; procedure TPCConfigFileStateList.Clear;
var var
i: Integer; i: Integer;
begin begin
@ -9322,10 +9331,10 @@ begin
fItems.Clear; fItems.Clear;
end; end;
procedure TFPCConfigFileStateList.Assign(List: TFPCConfigFileStateList); procedure TPCConfigFileStateList.Assign(List: TPCConfigFileStateList);
var var
i: Integer; i: Integer;
Item: TFPCConfigFileState; Item: TPCConfigFileState;
begin begin
Clear; Clear;
for i:=0 to List.Count-1 do begin for i:=0 to List.Count-1 do begin
@ -9334,7 +9343,7 @@ begin
end; end;
end; end;
function TFPCConfigFileStateList.Equals(List: TFPCConfigFileStateList; function TPCConfigFileStateList.Equals(List: TPCConfigFileStateList;
CheckDates: boolean): boolean; CheckDates: boolean): boolean;
var var
i: Integer; i: Integer;
@ -9346,34 +9355,34 @@ begin
Result:=true; Result:=true;
end; end;
function TFPCConfigFileStateList.Add(aFilename: string; aFileExists: boolean; function TPCConfigFileStateList.Add(aFilename: string; aFileExists: boolean;
aFileDate: longint): TFPCConfigFileState; aFileDate: longint): TPCConfigFileState;
begin begin
Result:=TFPCConfigFileState.Create(aFilename,aFileExists,aFileDate); Result:=TPCConfigFileState.Create(aFilename,aFileExists,aFileDate);
fItems.Add(Result); fItems.Add(Result);
end; end;
function TFPCConfigFileStateList.Count: integer; function TPCConfigFileStateList.Count: integer;
begin begin
Result:=fItems.Count; Result:=fItems.Count;
end; end;
procedure TFPCConfigFileStateList.LoadFromXMLConfig(XMLConfig: TXMLConfig; procedure TPCConfigFileStateList.LoadFromXMLConfig(XMLConfig: TXMLConfig;
const Path: string); const Path: string);
var var
Cnt: integer; Cnt: integer;
Item: TFPCConfigFileState; Item: TPCConfigFileState;
i: Integer; i: Integer;
begin begin
Cnt:=XMLConfig.GetValue(Path+'Count',0); Cnt:=XMLConfig.GetValue(Path+'Count',0);
for i:=1 to Cnt do begin for i:=1 to Cnt do begin
Item:=TFPCConfigFileState.Create('',false,0); Item:=TPCConfigFileState.Create('',false,0);
Item.LoadFromXMLConfig(XMLConfig,Path+'Item'+IntToStr(i)+'/'); Item.LoadFromXMLConfig(XMLConfig,Path+'Item'+IntToStr(i)+'/');
fItems.Add(Item); fItems.Add(Item);
end; end;
end; end;
procedure TFPCConfigFileStateList.SaveToXMLConfig(XMLConfig: TXMLConfig; procedure TPCConfigFileStateList.SaveToXMLConfig(XMLConfig: TXMLConfig;
const Path: string); const Path: string);
var var
i: Integer; i: Integer;
@ -9383,9 +9392,9 @@ begin
XMLConfig.SetDeleteValue(Path+'Count',Count,0); XMLConfig.SetDeleteValue(Path+'Count',Count,0);
end; end;
{ TFPCConfigFileState } { TPCConfigFileState }
constructor TFPCConfigFileState.Create(const aFilename: string; constructor TPCConfigFileState.Create(const aFilename: string;
aFileExists: boolean; aFileDate: longint); aFileExists: boolean; aFileDate: longint);
begin begin
Filename:=aFilename; Filename:=aFilename;
@ -9393,7 +9402,7 @@ begin
FileDate:=aFileDate; FileDate:=aFileDate;
end; end;
function TFPCConfigFileState.Equals(Other: TFPCConfigFileState; function TPCConfigFileState.Equals(Other: TPCConfigFileState;
CheckDate: boolean): boolean; CheckDate: boolean): boolean;
begin begin
Result:=false; Result:=false;
@ -9402,7 +9411,7 @@ begin
Result:=true; Result:=true;
end; end;
procedure TFPCConfigFileState.LoadFromXMLConfig(XMLConfig: TXMLConfig; procedure TPCConfigFileState.LoadFromXMLConfig(XMLConfig: TXMLConfig;
const Path: string); const Path: string);
begin begin
Filename:=XMLConfig.GetValue(Path+'Filename',''); Filename:=XMLConfig.GetValue(Path+'Filename','');
@ -9410,7 +9419,7 @@ begin
FileDate:=XMLConfig.GetValue(Path+'Date',0); FileDate:=XMLConfig.GetValue(Path+'Date',0);
end; end;
procedure TFPCConfigFileState.SaveToXMLConfig(XMLConfig: TXMLConfig; procedure TPCConfigFileState.SaveToXMLConfig(XMLConfig: TXMLConfig;
const Path: string); const Path: string);
begin begin
XMLConfig.SetDeleteValue(Path+'Filename',Filename,''); XMLConfig.SetDeleteValue(Path+'Filename',Filename,'');
@ -9730,7 +9739,7 @@ end;
{ TCompilerDefinesCache } { TCompilerDefinesCache }
procedure TCompilerDefinesCache.SetConfigCaches(const AValue: TFPCTargetConfigCaches); procedure TCompilerDefinesCache.SetConfigCaches(const AValue: TPCTargetConfigCaches);
begin begin
if FConfigCaches=AValue then exit; if FConfigCaches=AValue then exit;
FConfigCaches:=AValue; FConfigCaches:=AValue;
@ -9776,7 +9785,7 @@ end;
constructor TCompilerDefinesCache.Create(AOwner: TComponent); constructor TCompilerDefinesCache.Create(AOwner: TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
ConfigCaches:=TFPCTargetConfigCaches.Create(nil); ConfigCaches:=TPCTargetConfigCaches.Create(nil);
SourceCaches:=TFPCSourceCaches.Create(nil); SourceCaches:=TFPCSourceCaches.Create(nil);
fUnitToSrcCaches:=TFPList.Create; fUnitToSrcCaches:=TFPList.Create;
end; end;
@ -9861,7 +9870,7 @@ end;
function TCompilerDefinesCache.GetFPCVersion(const CompilerFilename, TargetOS, function TCompilerDefinesCache.GetFPCVersion(const CompilerFilename, TargetOS,
TargetCPU: string; UseCompiledVersionAsDefault: boolean): string; TargetCPU: string; UseCompiledVersionAsDefault: boolean): string;
var var
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
ErrorMsg: string; ErrorMsg: string;
begin begin
if UseCompiledVersionAsDefault then if UseCompiledVersionAsDefault then
@ -10103,7 +10112,7 @@ begin
end; end;
function TFPCUnitSetCache.GetConfigCache(AutoUpdate: boolean function TFPCUnitSetCache.GetConfigCache(AutoUpdate: boolean
): TFPCTargetConfigCache; ): TPCTargetConfigCache;
begin begin
if CompilerFilename='' then if CompilerFilename='' then
raise Exception.Create('TFPCUnitToSrcCache.GetConfigCache missing CompilerFilename'); raise Exception.Create('TFPCUnitToSrcCache.GetConfigCache missing CompilerFilename');
@ -10135,7 +10144,7 @@ end;
function TFPCUnitSetCache.GetSourceRules(AutoUpdate: boolean function TFPCUnitSetCache.GetSourceRules(AutoUpdate: boolean
): TFPCSourceRules; ): TFPCSourceRules;
var var
Cfg: TFPCTargetConfigCache; Cfg: TPCTargetConfigCache;
NewRules: TFPCSourceRules; NewRules: TFPCSourceRules;
begin begin
Cfg:=GetConfigCache(AutoUpdate); Cfg:=GetConfigCache(AutoUpdate);
@ -10162,7 +10171,7 @@ var
SrcRules: TFPCSourceRules; SrcRules: TFPCSourceRules;
NewUnitToSourceTree: TStringToStringTree; NewUnitToSourceTree: TStringToStringTree;
NewSrcDuplicates: TStringToStringTree; NewSrcDuplicates: TStringToStringTree;
ConfigCache: TFPCTargetConfigCache; ConfigCache: TPCTargetConfigCache;
begin begin
Src:=GetSourceCache(AutoUpdate); Src:=GetSourceCache(AutoUpdate);
SrcRules:=GetSourceRules(AutoUpdate); SrcRules:=GetSourceRules(AutoUpdate);
@ -10217,7 +10226,7 @@ function TFPCUnitSetCache.GetUnitSrcFile(const AnUnitName: string;
} }
var var
Tree: TStringToStringTree; Tree: TStringToStringTree;
ConfigCache: TFPCTargetConfigCache; ConfigCache: TPCTargetConfigCache;
UnitInFPCPath: String; UnitInFPCPath: String;
begin begin
Result:=''; Result:='';
@ -10274,7 +10283,7 @@ end;
function TFPCUnitSetCache.GetCompiledUnitFile(const AUnitName: string): string; function TFPCUnitSetCache.GetCompiledUnitFile(const AUnitName: string): string;
var var
ConfigCache: TFPCTargetConfigCache; ConfigCache: TPCTargetConfigCache;
begin begin
Result:=''; Result:='';
ConfigCache:=GetConfigCache(false); ConfigCache:=GetConfigCache(false);
@ -10303,7 +10312,7 @@ end;
function TFPCUnitSetCache.GetFirstFPCCfg: string; function TFPCUnitSetCache.GetFirstFPCCfg: string;
var var
Cfg: TFPCTargetConfigCache; Cfg: TPCTargetConfigCache;
i: Integer; i: Integer;
begin begin
Result:=''; Result:='';

View File

@ -50,9 +50,9 @@ type
destructor Destroy; override; destructor Destroy; override;
procedure WriteHelp; virtual; procedure WriteHelp; virtual;
procedure Error(Msg: string; DoWriteHelp: Boolean); procedure Error(Msg: string; DoWriteHelp: Boolean);
procedure WriteCompilerInfo(ConfigCache: TFPCTargetConfigCache); procedure WriteCompilerInfo(ConfigCache: TPCTargetConfigCache);
procedure WriteNonExistingPPUPaths(ConfigCache: TFPCTargetConfigCache); procedure WriteNonExistingPPUPaths(ConfigCache: TPCTargetConfigCache);
procedure WriteDuplicatesInPPUPath(ConfigCache: TFPCTargetConfigCache); procedure WriteDuplicatesInPPUPath(ConfigCache: TPCTargetConfigCache);
procedure WriteMissingPPUSources(UnitSet: TFPCUnitSetCache); procedure WriteMissingPPUSources(UnitSet: TFPCUnitSetCache);
procedure WriteDuplicateSources(UnitSet: TFPCUnitSetCache); procedure WriteDuplicateSources(UnitSet: TFPCUnitSetCache);
procedure WriteUnitReport(UnitSet: TFPCUnitSetCache; const AnUnitName: string); procedure WriteUnitReport(UnitSet: TFPCUnitSetCache; const AnUnitName: string);
@ -69,7 +69,7 @@ var
TargetCPU: String; TargetCPU: String;
FPCSrcDir: String; FPCSrcDir: String;
UnitSet: TFPCUnitSetCache; UnitSet: TFPCUnitSetCache;
ConfigCache: TFPCTargetConfigCache; ConfigCache: TPCTargetConfigCache;
Options: TCodeToolsOptions; Options: TCodeToolsOptions;
begin begin
// quick check parameters // quick check parameters
@ -187,10 +187,10 @@ begin
end; end;
procedure TTestFPCSourceUnitRules.WriteCompilerInfo( procedure TTestFPCSourceUnitRules.WriteCompilerInfo(
ConfigCache: TFPCTargetConfigCache); ConfigCache: TPCTargetConfigCache);
var var
i: Integer; i: Integer;
CfgFile: TFPCConfigFileState; CfgFile: TPCConfigFileState;
begin begin
writeln('Compiler=',ConfigCache.Compiler); writeln('Compiler=',ConfigCache.Compiler);
writeln('TargetOS=',ConfigCache.TargetOS); writeln('TargetOS=',ConfigCache.TargetOS);
@ -213,7 +213,7 @@ begin
end; end;
procedure TTestFPCSourceUnitRules.WriteNonExistingPPUPaths( procedure TTestFPCSourceUnitRules.WriteNonExistingPPUPaths(
ConfigCache: TFPCTargetConfigCache); ConfigCache: TPCTargetConfigCache);
var var
SearchPaths: TStrings; SearchPaths: TStrings;
i: Integer; i: Integer;
@ -230,7 +230,7 @@ begin
end; end;
procedure TTestFPCSourceUnitRules.WriteDuplicatesInPPUPath( procedure TTestFPCSourceUnitRules.WriteDuplicatesInPPUPath(
ConfigCache: TFPCTargetConfigCache); ConfigCache: TPCTargetConfigCache);
var var
i: Integer; i: Integer;
Directory: String; Directory: String;
@ -306,7 +306,7 @@ var
UnitToSrc: TStringToStringTree; UnitToSrc: TStringToStringTree;
Node: TAVLTreeNode; Node: TAVLTreeNode;
Item: PStringToStringItem; Item: PStringToStringItem;
ConfigCache: TFPCTargetConfigCache; ConfigCache: TPCTargetConfigCache;
aUnitName: String; aUnitName: String;
Cnt: Integer; Cnt: Integer;
Filename: String; Filename: String;
@ -405,7 +405,7 @@ end;
procedure TTestFPCSourceUnitRules.WriteUnitReport(UnitSet: TFPCUnitSetCache; procedure TTestFPCSourceUnitRules.WriteUnitReport(UnitSet: TFPCUnitSetCache;
const AnUnitName: string); const AnUnitName: string);
var var
ConfigCache: TFPCTargetConfigCache; ConfigCache: TPCTargetConfigCache;
PPUFile: String; PPUFile: String;
SourceCache: TFPCSourceCache; SourceCache: TFPCSourceCache;
aTree: TStringToStringTree; aTree: TStringToStringTree;

View File

@ -42,7 +42,7 @@ var
Filename: string; Filename: string;
Dictionary: TUnitDictionary; Dictionary: TUnitDictionary;
UnitSet: TFPCUnitSetCache; UnitSet: TFPCUnitSetCache;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
AVLNode: TAVLTreeNode; AVLNode: TAVLTreeNode;
Item: PStringToStringItem; Item: PStringToStringItem;
Directory: String; Directory: String;

View File

@ -1050,7 +1050,7 @@ var
Found: Integer; Found: Integer;
UnitSet: TFPCUnitSetCache; UnitSet: TFPCUnitSetCache;
FPCSrcDir: String; FPCSrcDir: String;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
procedure AddItems(AddExactMatches: boolean); procedure AddItems(AddExactMatches: boolean);
var var

View File

@ -450,7 +450,7 @@ var
BaseDir: String; BaseDir: String;
UnitSetID: String; UnitSetID: String;
Cache: TFPCUnitSetCache; Cache: TFPCUnitSetCache;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
HasChanged: boolean; HasChanged: boolean;
begin begin
UnitSetID:=CodeToolBoss.GetUnitSetIDForDirectory(BaseDir{%H-}); UnitSetID:=CodeToolBoss.GetUnitSetIDForDirectory(BaseDir{%H-});

View File

@ -791,7 +791,7 @@ procedure TBuildManager.RescanCompilerDefines(ResetBuildTarget,
function FoundSystemPPU: boolean; function FoundSystemPPU: boolean;
var var
ConfigCache: TFPCTargetConfigCache; ConfigCache: TPCTargetConfigCache;
AFilename: string; AFilename: string;
begin begin
Result:=false; Result:=false;
@ -809,7 +809,7 @@ procedure TBuildManager.RescanCompilerDefines(ResetBuildTarget,
// for example: a 'make install' installs to /usr/local/lib/fpc // for example: a 'make install' installs to /usr/local/lib/fpc
// while the rpm/deb packages install to /usr/lib // while the rpm/deb packages install to /usr/lib
var var
Cfg: TFPCTargetConfigCache; Cfg: TPCTargetConfigCache;
Filename: String; Filename: String;
begin begin
Cfg:=UnitSetCache.GetConfigCache(false); Cfg:=UnitSetCache.GetConfigCache(false);
@ -1060,7 +1060,7 @@ end;
function TBuildManager.CompilerOnDiskChanged: boolean; function TBuildManager.CompilerOnDiskChanged: boolean;
var var
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
begin begin
Result:=false; Result:=false;
if UnitSetCache=nil then exit; if UnitSetCache=nil then exit;
@ -2103,7 +2103,7 @@ function TBuildManager.MacroFuncFPCVer(const Param: string; const Data: PtrInt;
TargetOS: String; TargetOS: String;
TargetCPU: String; TargetCPU: String;
CompilerFilename: String; CompilerFilename: String;
ConfigCache: TFPCTargetConfigCache; ConfigCache: TPCTargetConfigCache;
s: string; s: string;
begin begin
FFPC_FULLVERSION:=0; FFPC_FULLVERSION:=0;

View File

@ -92,10 +92,10 @@ type
function CheckSpecialCharsInPath(const Title, ExpandedPath: string): TModalResult; function CheckSpecialCharsInPath(const Title, ExpandedPath: string): TModalResult;
function CheckNonExistingSearchPaths(const Title, ExpandedPath: string): TModalResult; function CheckNonExistingSearchPaths(const Title, ExpandedPath: string): TModalResult;
function CheckCompilerExecutable(const CompilerFilename: string): TModalResult; function CheckCompilerExecutable(const CompilerFilename: string): TModalResult;
function CheckCompilerConfig(CfgCache: TFPCTargetConfigCache): TModalResult; function CheckCompilerConfig(CfgCache: TPCTargetConfigCache): TModalResult;
function FindAllPPUFiles(const AnUnitPath: string): TStrings; function FindAllPPUFiles(const AnUnitPath: string): TStrings;
function CheckMissingFPCPPUs(CfgCache: TFPCTargetConfigCache): TModalResult; function CheckMissingFPCPPUs(CfgCache: TPCTargetConfigCache): TModalResult;
function CheckCompilerDate(CfgCache: TFPCTargetConfigCache): TModalResult; function CheckCompilerDate(CfgCache: TPCTargetConfigCache): TModalResult;
function CheckForAmbiguousPPUs(SearchForPPUs: TStrings; function CheckForAmbiguousPPUs(SearchForPPUs: TStrings;
SearchInPPUs: TStrings = nil): TModalResult; SearchInPPUs: TStrings = nil): TModalResult;
function CheckFPCUnitPathsContainSources(const FPCCfgUnitPath: string function CheckFPCUnitPathsContainSources(const FPCCfgUnitPath: string
@ -413,10 +413,10 @@ begin
end; end;
function TCheckCompilerOptsDlg.CheckCompilerConfig( function TCheckCompilerOptsDlg.CheckCompilerConfig(
CfgCache: TFPCTargetConfigCache): TModalResult; CfgCache: TPCTargetConfigCache): TModalResult;
var var
i: Integer; i: Integer;
CfgFile: TFPCConfigFileState; CfgFile: TPCConfigFileState;
CfgCount: Integer; CfgCount: Integer;
begin begin
FTest:=cotCheckCompilerConfig; FTest:=cotCheckCompilerConfig;
@ -483,7 +483,7 @@ begin
end; end;
function TCheckCompilerOptsDlg.CheckMissingFPCPPUs( function TCheckCompilerOptsDlg.CheckMissingFPCPPUs(
CfgCache: TFPCTargetConfigCache): TModalResult; CfgCache: TPCTargetConfigCache): TModalResult;
function Check(const TheUnitname: string; Severity: TCompilerCheckMsgLvl function Check(const TheUnitname: string; Severity: TCompilerCheckMsgLvl
): Boolean; ): Boolean;
@ -521,7 +521,7 @@ begin
Result:=mrOk; Result:=mrOk;
end; end;
function TCheckCompilerOptsDlg.CheckCompilerDate(CfgCache: TFPCTargetConfigCache function TCheckCompilerOptsDlg.CheckCompilerDate(CfgCache: TPCTargetConfigCache
): TModalResult; ): TModalResult;
var var
MinPPUDate: LongInt; MinPPUDate: LongInt;
@ -850,7 +850,7 @@ var
cp: TParsedCompilerOptString; cp: TParsedCompilerOptString;
TargetCPU: String; TargetCPU: String;
TargetOS: String; TargetOS: String;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
FPC_PPUs: TStrings; FPC_PPUs: TStrings;
begin begin
Result:=mrCancel; Result:=mrCancel;

View File

@ -1367,7 +1367,7 @@ var
UnitSetChanged: Boolean; UnitSetChanged: Boolean;
UnitSet: TFPCUnitSetCache; UnitSet: TFPCUnitSetCache;
Filename: String; Filename: String;
ConfigCache: TFPCTargetConfigCache; ConfigCache: TPCTargetConfigCache;
Node: TAVLTreeNode; Node: TAVLTreeNode;
Item: PStringToStringItem; Item: PStringToStringItem;
begin begin

View File

@ -2164,7 +2164,7 @@ function TBaseCompilerOptions.GetEffectiveTargetOS: string;
var var
Vars: TCTCfgScriptVariables; Vars: TCTCfgScriptVariables;
UnitSet: TFPCUnitSetCache; UnitSet: TFPCUnitSetCache;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
begin begin
Result:=''; Result:='';
Vars:=GetBuildMacroValues(Self,true); Vars:=GetBuildMacroValues(Self,true);
@ -2187,7 +2187,7 @@ function TBaseCompilerOptions.GetEffectiveTargetCPU: string;
var var
Vars: TCTCfgScriptVariables; Vars: TCTCfgScriptVariables;
UnitSet: TFPCUnitSetCache; UnitSet: TFPCUnitSetCache;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
begin begin
Result:=''; Result:='';
Vars:=GetBuildMacroValues(Self,true); Vars:=GetBuildMacroValues(Self,true);

View File

@ -460,7 +460,7 @@ var
NewFPCSrcDir: string; NewFPCSrcDir: string;
Note: string; Note: string;
Quality: TSDFilenameQuality; Quality: TSDFilenameQuality;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
FPCVer: String; FPCVer: String;
begin begin
if EnvironmentOptions.FPCSourceDirectory=FOldFPCSourceDir then exit(true); if EnvironmentOptions.FPCSourceDirectory=FOldFPCSourceDir then exit(true);

View File

@ -954,7 +954,7 @@ var
Code: TCodeBuffer; Code: TCodeBuffer;
AltFilename: String; AltFilename: String;
UnitSet: TFPCUnitSetCache; UnitSet: TFPCUnitSetCache;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
begin begin
Result:=nil; Result:=nil;
Filename:=EnvironmentOptions.GetParsedCompilerMessagesFilename; Filename:=EnvironmentOptions.GetParsedCompilerMessagesFilename;

View File

@ -139,7 +139,7 @@ var
TargetCPU: String; TargetCPU: String;
CompilerFilename: String; CompilerFilename: String;
CompilerOptions: String; CompilerOptions: String;
Cfg: TFPCTargetConfigCache; Cfg: TPCTargetConfigCache;
Params: String; Params: String;
ExtraOptions: String; ExtraOptions: String;
sl, List: TStringList; sl, List: TStringList;
@ -296,9 +296,9 @@ end;
procedure TIDEFPCInfoDialog.GatherFPCExecutable(UnitSetCache: TFPCUnitSetCache; procedure TIDEFPCInfoDialog.GatherFPCExecutable(UnitSetCache: TFPCUnitSetCache;
sl: TStrings); sl: TStrings);
var var
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
i: Integer; i: Integer;
CfgFileItem: TFPCConfigFileState; CfgFileItem: TPCConfigFileState;
HasCfgs: Boolean; HasCfgs: Boolean;
SrcCache: TFPCSourceCache; SrcCache: TFPCSourceCache;
AFilename: string; AFilename: string;

View File

@ -277,7 +277,7 @@ end;
procedure TIDEInfoDialog.GatherGlobalOptions(sl: TStrings); procedure TIDEInfoDialog.GatherGlobalOptions(sl: TStrings);
var var
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
Note: string; Note: string;
begin begin
sl.add('Global IDE options:'); sl.add('Global IDE options:');

View File

@ -970,7 +970,7 @@ var
Quality: TSDFilenameQuality; Quality: TSDFilenameQuality;
s: String; s: String;
ImageIndex: Integer; ImageIndex: Integer;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
begin begin
if csDestroying in ComponentState then exit; if csDestroying in ComponentState then exit;
CurCaption:=CompilerComboBox.Text; CurCaption:=CompilerComboBox.Text;

View File

@ -316,7 +316,7 @@ end;
function CheckCompilerQuality(AFilename: string; out Note: string; function CheckCompilerQuality(AFilename: string; out Note: string;
TestSrcFilename: string): TSDFilenameQuality; TestSrcFilename: string): TSDFilenameQuality;
var var
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
function CheckPPU(const AnUnitName: string): boolean; function CheckPPU(const AnUnitName: string): boolean;
begin begin
@ -591,7 +591,7 @@ function CheckPas2jsQuality(AFilename: string; out Note: string;
var var
i: LongInt; i: LongInt;
ShortFilename: String; ShortFilename: String;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
begin begin
Result:=sddqInvalid; Result:=sddqInvalid;
AFilename:=TrimFilename(AFilename); AFilename:=TrimFilename(AFilename);

View File

@ -288,7 +288,7 @@ procedure TInspectChksumChgDialog.SearchInFPCFiles(
var var
UnitSetID: String; UnitSetID: String;
UnitSet: TFPCUnitSetCache; UnitSet: TFPCUnitSetCache;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
i: Integer; i: Integer;
HasChanged: boolean; HasChanged: boolean;
CurDir: String; CurDir: String;

View File

@ -1103,6 +1103,7 @@
<Filename Value="helpfpcmessages.pas"/> <Filename Value="helpfpcmessages.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<UnitName Value="HelpFPCMessages"/>
</Unit183> </Unit183>
<Unit184> <Unit184>
<Filename Value="genericchecklist.pas"/> <Filename Value="genericchecklist.pas"/>

View File

@ -1367,7 +1367,7 @@ end;
procedure TMainIDE.SetupInteractive; procedure TMainIDE.SetupInteractive;
var var
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
OldLazDir: String; OldLazDir: String;
Note: string; Note: string;
OI: TSimpleWindowLayout; OI: TSimpleWindowLayout;

View File

@ -2611,7 +2611,7 @@ end;
function TLazPackageGraph.FindPkgOutputInFPCSearchPath(APackage: TLazPackage; function TLazPackageGraph.FindPkgOutputInFPCSearchPath(APackage: TLazPackage;
FirstDependency: TPkgDependency): TFPList; FirstDependency: TPkgDependency): TFPList;
var var
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
function CheckPkg(Pkg: TLazPackage; var PathList: TFPList): boolean; function CheckPkg(Pkg: TLazPackage; var PathList: TFPList): boolean;
var var
@ -3280,7 +3280,7 @@ var
UnitSetID: String; UnitSetID: String;
HasChanged: boolean; HasChanged: boolean;
Cache: TFPCUnitSetCache; Cache: TFPCUnitSetCache;
CfgCache: TFPCTargetConfigCache; CfgCache: TPCTargetConfigCache;
Node: TAVLTreeNode; Node: TAVLTreeNode;
Item: PStringToStringItem; Item: PStringToStringItem;
Filename: String; Filename: String;