mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 16:09:17 +02:00
* do not automatically register the RC reader, because it captures any file, instead handle that in fpcres itself if the output format calls for it
git-svn-id: trunk@46395 -
This commit is contained in:
parent
226ee14c20
commit
bd6d1e0b6a
@ -127,6 +127,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
TResources.RegisterReader('.rc',TRCResourceReader);
|
{ don't register automatically, as this is essentially a "catch all" }
|
||||||
|
//TResources.RegisterReader('.rc',TRCResourceReader);
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -218,6 +218,7 @@ begin
|
|||||||
sourcefiles.FileList.AddStrings(params.InputFiles);
|
sourcefiles.FileList.AddStrings(params.InputFiles);
|
||||||
sourcefiles.RCDefines.AddStrings(params.RCDefines);
|
sourcefiles.RCDefines.AddStrings(params.RCDefines);
|
||||||
sourcefiles.RCIncludeDirs.AddStrings(params.RCIncludeDirs);
|
sourcefiles.RCIncludeDirs.AddStrings(params.RCIncludeDirs);
|
||||||
|
sourcefiles.RCMode:=CurrentTarget.objformat=ofRes;
|
||||||
try
|
try
|
||||||
sourcefiles.Load(resources);
|
sourcefiles.Load(resources);
|
||||||
except
|
except
|
||||||
|
@ -39,6 +39,7 @@ type
|
|||||||
fRCIncludeDirs: TStringList;
|
fRCIncludeDirs: TStringList;
|
||||||
fRCDefines: TStringList;
|
fRCDefines: TStringList;
|
||||||
fStreamList : TFPList;
|
fStreamList : TFPList;
|
||||||
|
fRCMode: Boolean;
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -46,6 +47,7 @@ type
|
|||||||
property FileList : TStringList read fFileList;
|
property FileList : TStringList read fFileList;
|
||||||
property RCIncludeDirs: TStringList read fRCIncludeDirs;
|
property RCIncludeDirs: TStringList read fRCIncludeDirs;
|
||||||
property RCDefines: TStringList read fRCDefines;
|
property RCDefines: TStringList read fRCDefines;
|
||||||
|
property RCMode: Boolean read fRCMode write fRCMode;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -61,6 +63,7 @@ begin
|
|||||||
fStreamList:=TFPList.Create;
|
fStreamList:=TFPList.Create;
|
||||||
fRCDefines:= TStringList.Create;
|
fRCDefines:= TStringList.Create;
|
||||||
fRCIncludeDirs:= TStringList.Create;
|
fRCIncludeDirs:= TStringList.Create;
|
||||||
|
fRCMode:=False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TSourceFiles.Destroy;
|
destructor TSourceFiles.Destroy;
|
||||||
@ -92,11 +95,15 @@ begin
|
|||||||
raise ECantOpenFileException.Create(fFileList[i]);
|
raise ECantOpenFileException.Create(fFileList[i]);
|
||||||
end;
|
end;
|
||||||
fStreamList.Add(aStream);
|
fStreamList.Add(aStream);
|
||||||
try
|
{ the RC reader reads anything, so handle that separately }
|
||||||
aReader:=TResources.FindReader(aStream);
|
if fRCMode then
|
||||||
except
|
aReader:=TRCResourceReader.Create
|
||||||
raise EUnknownInputFormatException.Create(fFileList[i]);
|
else
|
||||||
end;
|
try
|
||||||
|
aReader:=TResources.FindReader(aStream);
|
||||||
|
except
|
||||||
|
raise EUnknownInputFormatException.Create(fFileList[i]);
|
||||||
|
end;
|
||||||
Messages.DoVerbose(Format('Chosen reader: %s',[aReader.Description]));
|
Messages.DoVerbose(Format('Chosen reader: %s',[aReader.Description]));
|
||||||
try
|
try
|
||||||
Messages.DoVerbose('Reading resource information...');
|
Messages.DoVerbose('Reading resource information...');
|
||||||
|
Loading…
Reference in New Issue
Block a user