From b245f2deb18e846d47ce27374a5f715125f44732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Wed, 22 May 2024 20:32:03 +0200 Subject: [PATCH] * Option to warn about not found resource files instead of error --- packages/fcl-passrc/src/pscanner.pp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/fcl-passrc/src/pscanner.pp b/packages/fcl-passrc/src/pscanner.pp index b6ec9c4b8a..cfdf85ee3c 100644 --- a/packages/fcl-passrc/src/pscanner.pp +++ b/packages/fcl-passrc/src/pscanner.pp @@ -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);