IDE: warn if fpc has no config file

git-svn-id: trunk@28939 -
This commit is contained in:
mattias 2011-01-10 16:51:08 +00:00
parent a2157c46f8
commit dc5709cc8a
3 changed files with 27 additions and 0 deletions

View File

@ -840,6 +840,7 @@ type
class function GetInvalidChangeStamp: integer;
procedure IncreaseChangeStamp;
function GetUnitSetID: string;
function GetFirstFPCCfg: string;
end;
{ TFPCDefinesCache }
@ -8823,6 +8824,23 @@ begin
CompilerOptions,FPCSourceDirectory,ChangeStamp);
end;
function TFPCUnitSetCache.GetFirstFPCCfg: string;
var
Cfg: TFPCTargetConfigCache;
i: Integer;
begin
Result:='';
Cfg:=GetConfigCache(false);
if Cfg=nil then exit;
if Cfg.ConfigFiles=nil then exit;
for i:=0 to Cfg.ConfigFiles.Count-1 do begin
if Cfg.ConfigFiles[i].FileExists then begin
Result:=Cfg.ConfigFiles[i].Filename;
exit;
end;
end;
end;
initialization
InitDefaultFPCSourceRules;

View File

@ -712,6 +712,12 @@ begin
Format(lisTheProjectUsesTargetOSAndCPUTheSystemPpuForThisTar, [
TargetOS, TargetCPU, #13, #13]),
mtError,[mbOk]);
end else if (UnitSetCache<>nil) then begin
if UnitSetCache.GetFirstFPCCfg='' then begin
IDEMessageDialog(lisCCOWarningCaption,
lisTheCurrentFPCHasNoConfigFileItWillProbablyMissSome,
mtWarning,[mbOk]);
end;
end;
end;

View File

@ -5095,6 +5095,9 @@ resourcestring
lisApplyConventions = 'Apply conventions';
lisKeepRelativeIndentationOfMultiLineTemplate = 'Keep relative indentation '
+'of multi line template';
lisTheCurrentFPCHasNoConfigFileItWillProbablyMissSome = 'The current FPC '
+'has no config file. It will probably miss some units. Check your '
+'installation of fpc.';
implementation