mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 06:20:57 +02:00
* Option to warn about not found resource files instead of error
This commit is contained in:
parent
d729d5a5b1
commit
b245f2deb1
@ -730,7 +730,8 @@ type
|
||||
po_AsyncProcs, // allow async procedure modifier
|
||||
po_DisableResources, // Disable resources altogether
|
||||
po_AsmPascalComments, // Allow pascal comments/directives in asm blocks
|
||||
po_AllowMem // Allow use of meml, mem, memw arrays
|
||||
po_AllowMem, // Allow use of meml, mem, memw arrays
|
||||
po_WarnResourceNotFound // Do not raise error if resource not found.
|
||||
);
|
||||
TPOptions = set of TPOption;
|
||||
|
||||
@ -4432,8 +4433,11 @@ begin
|
||||
If (ChangeFileExt(aFileName,RTLString(''))='*') then
|
||||
aFileName:=ChangeFileExt(ExtractFileName(CurFilename),Ext);
|
||||
aFullFileName:=FileResolver.FindResourceFileName(aFileName);
|
||||
if aFullFileName='' then
|
||||
Error(nResourceFileNotFound,SErrResourceFileNotFound,[aFileName]);
|
||||
if (aFullFileName='') then
|
||||
if (po_WarnResourceNotFound in Options) then
|
||||
Self.DoLog(mtWarning,nResourceFileNotFound,SErrResourceFileNotFound,[aFileName])
|
||||
else
|
||||
Error(nResourceFileNotFound,SErrResourceFileNotFound,[aFileName]);
|
||||
// Check if we can find a handler.
|
||||
if Ext<>'' then
|
||||
Ext:=Copy(Ext,2,Length(Ext)-1);
|
||||
|
Loading…
Reference in New Issue
Block a user